ReciprocalNoNanΒΆ
Safe reciprocal, returns 0 where input is 0.
Abstract Signature:
ReciprocalNoNan(x: Tensor)
PyTorch
API:
βStrategy: Macro 'torch.where({x} == 0, 0.0, 1.0 / {x})'
JAX (Core)
API:
βStrategy: Macro 'jnp.where({x} == 0, 0.0, 1.0 / {x})'
NumPy
API:
βStrategy: Macro 'np.where({x} == 0, 0.0, 1.0 / {x})'
Keras
API:
βStrategy: Macro 'keras.ops.where({x} == 0, 0.0, 1.0 / {x})'
Apple MLX
API:
βStrategy: Macro 'mx.where({x} == 0, 0.0, 1.0 / {x})'
Flax NNX
API:
βStrategy: Macro 'jnp.where({x} == 0, 0.0, 1.0 / {x})'
PaxML / Praxis
API:
βStrategy: Macro 'jnp.where({x} == 0, 0.0, 1.0 / {x})'