mlx.core.addmm

目录

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.

参数:
  • 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)

返回:

alpha * (a @ b)  + beta * c

返回类型:

array