mindspore.mint.bmm

View Source On AtomGit
mindspore.mint.bmm(input, mat2)[source]

Perform a batch matrix-matrix multiplication of two three-dimensional tensors.

\[\text{output}= \text{input} @ \text{mat2}\]

The dim of input and mat2 can only be 3.

Parameters
  • input (Tensor) – The first input tensor.

  • mat2 (Tensor) – The second input tensor.

Returns

Tensor

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> a = mindspore.mint.ones([2, 3, 4])
>>> b = mindspore.mint.ones([2, 4, 5])
>>> mindspore.mint.bmm(a, b)
    Tensor(shape=[2, 3, 5], dtype=Float32, value=
    [[[ 4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00],
      [ 4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00],
      [ 4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00]],
     [[ 4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00],
      [ 4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00],
      [ 4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00,  4.00000000e+00]]])