mindspore.ops.addn

View Source On Gitee
mindspore.ops.addn(x)[source]

Return the element-wise sum of all input tensors.

Parameters

x (Union(tuple[Tensor], list[Tensor])) – List of tensors or tuple of tensors.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> x = mindspore.tensor([1, 2, 3])
>>> y = mindspore.tensor([4, 5, 6])
>>> mindspore.ops.addn([x, y, x, y])
Tensor(shape=[3], dtype=Int64, value= [10, 14, 18])