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})'