mindspore/docs/api/api_python/mint/mindspore.mint.func_bmm.rst

23 lines
895 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.mint.bmm
===========================
.. py:function:: mindspore.mint.bmm(input, mat2)
基于batch维度的两个Tensor的矩阵乘法仅支持三维。
.. math::
\text{output} = \text{input} @ \text{mat2}
参数:
- **input** (Tensor) - 输入相乘的第一个Tensor。必须是三维Tensorshape为 :math:`(b, n, m)`
- **mat2** (Tensor) - 输入相乘的第二个Tensor。必须是三维Tensorshape为 :math:`(b, m, p)`
返回:
Tensor输出Tensor的shape为 :math:`(b, n, p)` 。其中每个矩阵是输入批次中相应矩阵的乘积。
异常:
- **ValueError** - `input``mat2` 的维度不为3。
- **ValueError** - `input` 第三维的长度不等于 `mat2` 第二维的长度。
- **ValueError** - `input` 的 batch 维长度不等于 `mat2` 的 batch 维长度。