SquaredDifferenceΒΆ

Returns (x - y)(x - y) element-wise.

Abstract Signature:

SquaredDifference(x: Tensor, y: Tensor)

PyTorch

API: β€”
Strategy: Macro 'torch.square({x} - {y})'

JAX (Core)

API: β€”
Strategy: Macro 'jnp.square({x} - {y})'

NumPy

API: β€”
Strategy: Macro 'numpy.square({x} - {y})'

Keras

API: β€”
Strategy: Macro 'keras.ops.square({x} - {y})'

TensorFlow

API: tf.math.squared_difference
Strategy: Direct Mapping

Apple MLX

API: β€”
Strategy: Macro 'mlx.core.square({x} - {y})'

Flax NNX

API: β€”
Strategy: Macro 'jnp.square({x} - {y})'

PaxML / Praxis

API: β€”
Strategy: Macro 'jnp.square({x} - {y})'