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

21 lines
851 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.inner
=====================
.. py:function:: mindspore.numpy.inner(a, b)
返回两个Tensor的内积。
对于1-D的Tensor这是向量的普通内积(不包含复共轭)。对于更高维的Tensor这是在最后一个轴上的求和积。
.. note::
不支持NumPy参数 `out`。 在GPU上支持的数据类型有np.float16和np.float32。在CPU上支持的数据类型有np.float16np.float32和np.float64。
参数:
- **a** (Tensor) - 输入Tensor。 如果 `a``b` 都不是标量,它们的最后一个维度必须匹配。
- **b** (Tensor) - 输入Tensor。 如果 `a``b` 都不是标量,它们的最后一个维度必须匹配。
返回:
Tensor或标量。
异常:
- **ValueError** - 如果 ``x1.shape[-1] != x2.shape[-1]``