dpnp.tensor.nonzero

dpnp.tensor.nonzero(arr)[source]

Return the indices of non-zero elements.

Returns a tuple of usm_ndarrays, one for each dimension of arr, containing the indices of the non-zero elements in that dimension. The values of arr are always tested in row-major, C-style order.

Parameters:

arr (usm_ndarray) -- Input array, which has non-zero array rank.

Returns:

out -- Indices of non-zero array elements.

Return type:

tuple of usm_ndarrays