torch.argwhere
- torch.argwhere(input) → Tensor
Returns a tensor containing the indices of all non-zero elements of
input. Each row in the result contains the indices of a non-zero element ininput. The result is sorted lexicographically, with the last index changing the fastest (C-style).If
has dimensions, then the resulting indices tensor is of size , where is the total number of non-zero elements in the tensor.