You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.func_matmul.rst 1.1 kB

4 years ago
123456789101112131415161718192021222324
  1. mindspore.ops.matmul
  2. =====================
  3. .. py:function:: mindspore.ops.matmul(x1, x2, dtype=None)
  4. 计算两个数组的乘积。
  5. .. note::
  6. 不支持NumPy参数 `out` 、 `casting` 、 `order` 、 `subok` 、 `signature` 、 `extobj` 。在GPU上支持的数据类型为np.float16和np.float32。在CPU上支持的数据类型为np.float16和np.float32。
  7. **参数:**
  8. - **x1** (Tensor) - 输入Tensor,不支持Scalar, `x1` 的最后一维度和 `x2` 的倒数第二维度相等,且 `x1` 和 `x2` 彼此支持广播。
  9. - **x2** (Tensor) - 输入Tensor,不支持Scalar, `x1` 的最后一维度和 `x2` 的倒数第二维度相等,且 `x1` 和 `x2` 彼此支持广播。
  10. - **dtype** (:class:`mindspore.dtype`, optional) - 指定输入Tensor的数据类型,默认:None。
  11. **返回:**
  12. Tensor或Scalar,矩阵乘积的输入。当 `x1` 和 `x2` 为一维向量时,输入为Scalar。
  13. **异常:**
  14. - **ValueError** - `x1` 的最后一维度和 `x2` 的倒数第二维度不相等,或者输入的是Scalar。
  15. - **ValueError** - `x1` 和 `x2` 彼此不能广播。