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

21 lines
1.1 KiB
ReStructuredText
Raw Normal View History

mindspore.ops.matmul
=====================
.. py:function:: mindspore.ops.matmul(input, other)
计算两个数组的乘积。
.. note::
不支持NumPy参数 `out``casting``order``subok``signature``extobj` 。在GPU上支持的数据类型为np.float16和np.float32。在CPU上支持的数据类型为np.float16和np.float32。
2022-07-25 17:18:38 +08:00
参数:
- **input** (Tensor) - 输入Tensor不支持Scalar `input` 的最后一维度和 `other` 的倒数第二维度相等,且 `input``other` 彼此支持广播。
- **other** (Tensor) - 输入Tensor不支持Scalar `input` 的最后一维度和 `other` 的倒数第二维度相等,且 `input``other` 彼此支持广播。
2022-07-25 17:18:38 +08:00
返回:
Tensor或Scalar输入的矩阵乘积。仅当 `input``other` 为一维向量时输出为Scalar。
2022-07-25 17:18:38 +08:00
异常:
- **ValueError** - `input` 的最后一维度和 `other` 的倒数第二维度不相等或者输入的是Scalar。
- **ValueError** - `input``other` 彼此不能广播。