addmm(input: Tensor, mat1: Tensor, mat2: Tensor, beta: _float = ..., alpha: _float = ...)General matrix multiply with a scaled accumulator (GEMM).
Computes ,
the canonical BLAS-3 gemm operation. Useful for fused linear
layers: an output bias plus a weight multiplication in one call.
Parameters
Returns
TensorTensor of shape (M, N).
Notes
Mathematical definition:
The inner dimension K must match between mat1 and mat2.
Standard dtype promotion applies; the matmul itself uses Accelerate
(CPU stream) or MLX (GPU stream).
Examples
>>> import lucid
>>> M = lucid.zeros((2, 2))
>>> a = lucid.tensor([[1., 2.], [3., 4.]])
>>> b = lucid.tensor([[5., 6.], [7., 8.]])
>>> lucid.addmm(M, a, b, beta=0.0, alpha=1.0)
Tensor([[19., 22.],
[43., 50.]])