torch.Tensor.index_fill Tensor.index_fill(dim, index, value) → Tensor Out-of-place version of torch.Tensor.index_fill_().