2022-12-05 19:48:54 +08:00
|
|
|
|
mindspore.ops.inner
|
|
|
|
|
|
====================
|
|
|
|
|
|
|
|
|
|
|
|
.. py:function:: mindspore.ops.inner(x, other)
|
|
|
|
|
|
|
2023-02-20 20:16:23 +08:00
|
|
|
|
计算两个1D Tensor的点积。
|
|
|
|
|
|
|
|
|
|
|
|
对于1D Tensor(没有复数共轭的情况),返回两个向量的点积。
|
|
|
|
|
|
|
|
|
|
|
|
对于更高的维度,返回最后一个轴上的和积。
|
2022-12-05 19:48:54 +08:00
|
|
|
|
|
2022-12-12 11:07:42 +08:00
|
|
|
|
.. note::
|
2023-02-20 20:16:23 +08:00
|
|
|
|
如果 `x` 或 `other` 之一是标量,那么 :func:`mindspore.ops.inner` 相当于 :func:`mindspore.ops.mul`。
|
2022-12-05 19:48:54 +08:00
|
|
|
|
|
|
|
|
|
|
参数:
|
|
|
|
|
|
- **x** (Tensor) - 第一个输入。
|
|
|
|
|
|
- **other** (Tensor) - 第二个输入。
|
|
|
|
|
|
|
|
|
|
|
|
返回:
|
|
|
|
|
|
Tensor,内积的结果。
|
|
|
|
|
|
|
|
|
|
|
|
异常:
|
2022-12-12 11:07:42 +08:00
|
|
|
|
- **ValueError** - 如果 `x` 和 `other` 都不是标量,且两者的最后一维不相同。
|