mindspore.ops.addbmm

mindspore.ops.addbmm(x, batch1, batch2, *, beta=1, alpha=1)[source]

Applies batch matrix multiplication to batch1 and batch2, with a reduced add step. The matrix x is add to final result.

The optional values alpha and beta are the matrix-matrix product between batch1 and batch2 and the scale factor for the added tensor x respectively. If beta is 0, then x will be ignored.

\[output = \beta x + \alpha (\sum_{i=0}^{b-1} {batch1 @ batch2})\]
Parameters
  • x (Tensor) – Tensor to be added.

  • batch1 (Tensor) – The first batch of tensor to be multiplied.

  • batch2 (Tensor) – The second batch of tensor to be multiplied.

Keyword Arguments
  • beta (Union[int, float], optional) – Multiplier for x. Default: 1.

  • alpha (Union[int, float], optional) – Multiplier for batch1 @ batch2. Default: 1.

Returns

Tensor, has the same dtype as x.

Raises

ValueError – If batch1, batch2 cannot apply batch matrix multiplication.

Supported Platforms:

Ascend GPU CPU