tensor.nonzero
Produces indices of the elements that are non-zero (in row-major order - by dimension).
Args
self
(@Tensor<T>
) - Tensor of data to calculate non-zero indices.
Returns
A new Tensor<usize>
indices of the elements that are non-zero (in row-major order - by dimension).
Example
Last updated