mindspore/docs/api/api_python/ops/mindspore.ops.func_addn.rst

19 lines
760 B
ReStructuredText
Raw Normal View History

mindspore.ops.addn
===================
.. py:function:: mindspore.ops.addn(x)
逐元素将所有输入的Tensor相加。
所有输入Tensor必须具有相同的shape。
2022-07-25 15:09:45 +08:00
参数:
- **x** (Union(tuple[Tensor], list[Tensor])) - Tensor组成的tuble或list类型为 `bool_ <https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.dtype.html#mindspore.dtype>`_`number <https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.dtype.html#mindspore.dtype>`_
2022-07-25 15:09:45 +08:00
返回:
Tensor`x` 的每个Tensor具有相同的shape和数据类型。
2022-07-25 15:09:45 +08:00
异常:
- **TypeError** - `x` 既不是tuple也不是list。
- **ValueError** - `x` 中存在shape不同的Tensor。