MultiplyNoNan ============= Computes product x*y, returns 0 if y is 0 (safe against NaNs in x). **Abstract Signature:** ``MultiplyNoNan(x: Tensor, y: Tensor)`` .. raw:: html

PyTorch

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

JAX (Core)

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

NumPy

API:
Strategy: Macro 'np.where({y} == 0, 0.0, {x} * {y})'

Keras

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

TensorFlow

API: tf.math.multiply_no_nan
Strategy: Direct Mapping

Apple MLX

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

Flax NNX

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

PaxML / Praxis

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