chainerx.sum

chainerx.sum(a, axis=None, keepdims=False)

Sum of array elements over a given axis.

Parameters
  • a (ndarray) – Input array.

  • axis (None or int or tuple of ints) – Axis or axes along which a sum is performed. The flattened array is used by default.

  • keepdims (bool) – If this is set to True, the reduced axes are left in the result as dimensions with size one.

Returns

The sum of input elements over a given axis.

Return type

ndarray

Note

During backpropagation, this function propagates the gradient of the output array to the input array a.

See also

numpy.sum()