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})'
TensorFlow
API: tf.math.reciprocal_no_nan
Strategy: Direct Mapping
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})'