Skip to main content

ClikaRT::ops::nonzero

function

nonzero()

Tensor nonzero(Tensor x)

Coordinates of the nonzero elements: an [n, ndim] Int64 matrix, one row per nonzero element of x.

The row count is data-dependent (see masked_select); a 1-arg where() call is sugar for this op.

Throws

  • ClikaRT::Error: when the input's dtype is not served for this operation (the machine-readable reason rides code_name()).

Returns: a new [n, ndim] Int64 coordinate matrix.

Declared in ClikaRT/compute/ops.h, line 2533