Skip to main content

nonzero

Function nonzero 

Source
pub fn nonzero<T: Numeric>(x: &Tensor<T>) -> Tensor<i64>
Expand description

Returns the indices of non-zero elements.

§Arguments

  • x - Input tensor

§Returns

Tensor of shape (num_nonzero, ndim) containing indices of non-zero elements