torch.Tensor.masked_fill_()

torch.Tensor.masked_fill_(mask, value)

Fills elements of self tensor with value where mask is True. The shape of mask must be broadcastable with the shape of the underlying tensor.

Parameters
  • mask (BoolTensor) – the boolean mask

  • value (float) – the value to fill in with

  

posted on 2022-09-17 16:55  朴素贝叶斯  阅读(178)  评论(0编辑  收藏  举报

导航