mindspore/docs/api/api_python/numpy/mindspore.numpy.matmul.rst

20 lines
917 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.numpy.matmul
======================
.. py:function:: mindspore.numpy.matmul(x1, x2, dtype=None)
返回两个数组的矩阵乘积。
.. note::
不支持NumPy参数 `out``casting``order``subok``signature``extobj` 。 在GPU上支持的数据类型有np.float16和np.float32。 在CPU上支持的数据类型有np.float16和np.float32。
参数:
- **x1** (Tensor) - 输入Tensor不允许标量。
- **x2** (Tensor) - 输入Tensor不允许标量。
- **dtype** (mindspore.dtype, 可选) - 默认值: `None` 。覆盖输出Tensor的dtype。
返回:
Tensor或标量输入的矩阵乘积。 如果 `x1``x2` 都是1-d向量返回标量。
异常:
- **ValueError** - 如果 `x1` 的最后一个维度的大小不等于 `x2` 的倒数第二个维度的大小,或者传入了标量值。