torch.Tensor.masked_scatter_
- Tensor.masked_scatter_(mask, source)
Copies elements from
sourceintoselftensor at positions where themaskis True. Elements fromsourceare copied intostarting at position 0 of and continuing in order one-by-one for each occurrence of being True. The shape of must be with the shape of the underlying tensor. The should have at least as many elements as the number of ones in .