CountNonzeroΒΆ
Counts the number of non-zero values in the tensor input along the given dim.
Abstract Signature:
CountNonzero(input: Tensor, dim: Union[int, Tuple[int]])
Apple MLX
API:
mlx.core.count_nonzeroStrategy: Macro 'mlx.core.sum({a} != 0, axis={axis})'