NonZeroΒΆ

Returns a tensor containing the indices of all non-zero elements of input.

Abstract Signature:

NonZero(input: Tensor)

PyTorch

API: torch.nonzero
Strategy: Macro 'torch.nonzero({a}, as_tuple=True)'

JAX (Core)

API: jax.numpy.argwhere
Strategy: Direct Mapping

NumPy

API: numpy.argwhere
Strategy: Direct Mapping

Keras

API: keras.ops.nonzero
Strategy: Direct Mapping

TensorFlow

API: tf.where
Strategy: Direct Mapping

Apple MLX

API: mlx.core.argwhere
Strategy: Direct Mapping

Flax NNX

API: jax.numpy.argwhere
Strategy: Direct Mapping

PaxML / Praxis

API: jax.numpy.argwhere
Strategy: Direct Mapping