DivideNoNan =========== Computes a safe divide which returns 0 if `y` (denominator) is zero. **Abstract Signature:** ``DivideNoNan(x: Tensor, y: Tensor)`` .. raw:: html

PyTorch

API:
Strategy: Macro 'torch.where({y} == 0, torch.zeros_like({x}), {x} / {y})'

JAX (Core)

API:
Strategy: Macro 'jnp.where({y} == 0, 0, {x} / {y})'

Keras

API:
Strategy: Macro 'keras.ops.where({y} == 0, 0, {x} / {y})'

TensorFlow

API: tf.math.divide_no_nan
Strategy: Direct Mapping

Apple MLX

API:
Strategy: Macro 'mx.where({y} == 0, 0, {x} / {y})'

Flax NNX

API:
Strategy: Macro 'jnp.where({y} == 0, 0, {x} / {y})'

PaxML / Praxis

API:
Strategy: Macro 'jnp.where({y} == 0, 0, {x} / {y})'