chainer.functions.sum

chainer.functions.sum(x, axis=None, keepdims=False)[source]

Sum of array elements over a given axis.

Parameters:
  • x (Variable) – Elements to sum.
  • axis (None, int, or tuple of int) – Axis which a sum is performed. The default (axis = None) is perform a sum over all the dimensions of the input array.
  • keepdims (bool) – If True, the specified axes are remained as axes of length one.
Returns:

Output variable.

Return type:

Variable