mlx.core.addmm

Contents

mlx.core.addmm#

addmm(c: array, a: array, b: array, /, alpha: float = 1.0, beta: float = 1.0, *, stream: None | Stream | Device = None) array#

Matrix multiplication with addition and optional scaling.

Perform the (possibly batched) matrix multiplication of two arrays and add to the result with optional scaling factors.

Parameters:
  • c (array) – Input array or scalar.

  • a (array) – Input array or scalar.

  • b (array) – Input array or scalar.

  • alpha (float, optional) – Scaling factor for the matrix product of a and b (default: 1)

  • beta (float, optional) – Scaling factor for c (default: 1)

Returns:

alpha * (a @ b)  + beta * c

Return type:

array