mindspore/docs/api/api_python/ops/mindspore.ops.func_mm.rst

23 lines
927 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.ops.mm
=================
.. py:function:: mindspore.ops.mm(mat1, mat2)
计算两个矩阵的乘积。
如果 `mat1` 是一个 :math:`(n \times m)` 的Tensor`mat2` 是一个 :math:`(m \times p)` 的Tensor`out` 则会是一个 :math:`(n \times p)` 的Tensor。
.. note::
此函数不能支持广播。若需要可广播的方法,请参考 :func:`mindspore.ops.matmul`
参数:
- **mat1** (Tensor) - 矩阵相乘的第一个矩阵, `mat1` 的最后一维度必须和 `mat2` 的第一维度相等。
- **mat2** (Tensor) - 矩阵相乘的第二个矩阵, `mat1` 的最后一维度必须和 `mat2` 的第一维度相等。
返回:
Tensor输入的矩阵乘积。
异常:
- **ValueError** - `mat1` 的最后一维度和 `mat2` 的倒数第二维度不相等。
- **ValueError** - `mat1` 或者 `mat2` 不是一个矩阵。