AddrΒΆ

Performs the outer-product of vectors vec1 and vec2 and adds it to the matrix input.

Abstract Signature:

Addr(input: Tensor, vec1: Tensor, vec2: Tensor, beta: float = 1.0, alpha: float = 1.0)

PyTorch

API: torch.addr
Strategy: Direct Mapping

JAX (Core)

API: β€”
Strategy: Macro 'jnp.add({beta} * {input}, {alpha} * jnp.outer({vec1}, {vec2}))'

NumPy

API: β€”
Strategy: Macro '{beta} * {input} + {alpha} * np.outer({vec1}, {vec2})'

Keras

API: β€”
Strategy: Macro 'keras.ops.add({beta} * {input}, {alpha} * keras.ops.outer({vec1}, {vec2}))'

TensorFlow

API: β€”
Strategy: Macro 'tf.math.add({beta} * {input}, {alpha} * tf.tensordot({vec1}, {vec2}, axes=0))'

Apple MLX

API: β€”
Strategy: Macro 'mx.add({beta} * {input}, {alpha} * mx.outer({vec1}, {vec2}))'

Flax NNX

API: β€”
Strategy: Macro 'jnp.add({beta} * {input}, {alpha} * jnp.outer({vec1}, {vec2}))'

PaxML / Praxis

API: β€”
Strategy: Macro 'jnp.add({beta} * {input}, {alpha} * jnp.outer({vec1}, {vec2}))'