cupy.flatnonzero#

cupy.flatnonzero(a)[source]#

Return indices that are non-zero in the flattened version of a.

This is equivalent to a.ravel().nonzero()[0].

Parameters:

a (cupy.ndarray) – input array

Returns:

Output array, containing the indices of the elements of a.ravel() that are non-zero.

Return type:

cupy.ndarray

Warning

This function may synchronize the device.