2022-04-16 17:16:29 +08:00
|
|
|
|
mindspore.ops.addn
|
|
|
|
|
|
===================
|
|
|
|
|
|
|
|
|
|
|
|
.. py:function:: mindspore.ops.addn(x)
|
|
|
|
|
|
|
|
|
|
|
|
逐元素将所有输入的Tensor相加。
|
|
|
|
|
|
|
|
|
|
|
|
所有输入Tensor必须具有相同的shape。
|
|
|
|
|
|
|
2022-07-25 15:09:45 +08:00
|
|
|
|
参数:
|
2022-10-08 09:39:24 +08:00
|
|
|
|
- **x** (Union(tuple[Tensor], list[Tensor])) - Tensor组成的tuble或list。
|
2022-04-16 17:16:29 +08:00
|
|
|
|
|
2022-07-25 15:09:45 +08:00
|
|
|
|
返回:
|
|
|
|
|
|
Tensor,与 `x` 的每个Tensor具有相同的shape和数据类型。
|
2022-04-16 17:16:29 +08:00
|
|
|
|
|
2022-07-25 15:09:45 +08:00
|
|
|
|
异常:
|
|
|
|
|
|
- **TypeError** - `x` 既不是tuple,也不是list。
|
|
|
|
|
|
- **ValueError** - `x` 中存在shape不同的Tensor。
|