addbmm(input: Tensor, batch1: Tensor, batch2: Tensor, beta: _float = ..., alpha: _float = ...)Batched matmul with reduction over the batch axis.
Computes . Useful for accumulating multiple parallel matrix products into a single output matrix (e.g. summing per-head attention contributions).
Parameters
Returns
TensorTensor of shape (M, N).
Notes
Mathematical definition:
Differs from baddbmm in that the batch dimension is reduced
away; baddbmm keeps the per-batch results.
Examples
>>> import lucid
>>> b1 = lucid.ones((3, 2, 4))
>>> b2 = lucid.ones((3, 4, 2))
>>> M = lucid.zeros((2, 2))
>>> lucid.addbmm(M, b1, b2)
Tensor([[12., 12.],
[12., 12.]])