parameters: (input, out=None)
return_statement: return out
docstring: r"""
      This function computes the sum of multiple input Tensors elementwisely.
  
      - Case 1, sum of 3 Tensors
  
      .. code-block:: text
  
          # Input Tensors
          x0.shape = [2, 3]
          x0.data = [[1., 2., 3.],
                     [4., 5., 6.]]
          x1.shape = [2, 3]
          x1.data = [[10., 20., 30.],
                     [40., 50., 60.]]
          x2.shape = [2, 3]
          x2.data = [[100., 200., 300.],
                     [400., 500., 600.]]
  
          # Output Tensor
          out.shape = [2, 3]
          out.data = [[111., 222., 333.],
                      [444., 555., 666.]]
  
      Args:
          input (list): A list of Variables which hold input Tensors with the same
              data type and shape. Optional data types are: float32, float64, int32, int64.
          out (Variable, optional): Output Tensor. It can be any existing Variable.
              The default value is None, then a new Variable will be created and returned.
  
      Returns:
          Variable: The sum of inputs. The shape and data type is the same with input. \
              If :code:`out` is not None, the returned value is :code:`out` .
  
      Examples:
          .. code-block:: python
  
              import paddle.fluid as fluid
  
              x0 = fluid.layers.fill_constant(shape=[16, 32], dtype='int64', value=1)
              x1 = fluid.layers.fill_constant(shape=[16, 32], dtype='int64', value=2)
              x2 = fluid.layers.fill_constant(shape=[16, 32], dtype='int64', value=3)
              x3 = fluid.layers.fill_constant(shape=[16, 32], dtype='int64', value=0)
  
              # Sum of multiple Tensors, the result is stored to a new Variable sum0 (sum0=x0+x1+x2, the value is [[6, ..., 6], ..., [6, ..., 6]])
              sum0 = fluid.layers.sums(input=[x0, x1, x2])
  
              # Sum of multiple Tensors, sum1 and x3 represents the same Variable (x3=x0+x1+x2, the value is [[6, ..., 6], ..., [6, ..., 6]])
              sum1 = fluid.layers.sums(input=[x0, x1, x2], out=x3)
docstring_summary: r"""
      This function computes the sum of multiple input Tensors elementwisely.
docstring_tokens: r This function computes the sum of multiple input Tensors elementwisely .
function: def sums(input, out=None):
      r"""
      This function computes the sum of multiple input Tensors elementwisely.
  
      - Case 1, sum of 3 Tensors
  
      .. code-block:: text
  
          # Input Tensors
          x0.shape = [2, 3]
          x0.data = [[1., 2., 3.],
                     [4., 5., 6.]]
          x1.shape = [2, 3]
          x1.data = [[10., 20., 30.],
                     [40., 50., 60.]]
          x2.shape = [2, 3]
          x2.data = [[100., 200., 300.],
                     [400., 500., 600.]]
  
          # Output Tensor
          out.shape = [2, 3]
          out.data = [[111., 222., 333.],
                      [444., 555., 666.]]
  
      Args:
          input (list): A list of Variables which hold input Tensors with the same
              data type and shape. Optional data types are: float32, float64, int32, int64.
          out (Variable, optional): Output Tensor. It can be any existing Variable.
              The default value is None, then a new Variable will be created and returned.
  
      Returns:
          Variable: The sum of inputs. The shape and data type is the same with input. \
              If :code:`out` is not None, the returned value is :code:`out` .
  
      Examples:
          .. code-block:: python
  
              import paddle.fluid as fluid
  
              x0 = fluid.layers.fill_constant(shape=[16, 32], dtype='int64', value=1)
              x1 = fluid.layers.fill_constant(shape=[16, 32], dtype='int64', value=2)
              x2 = fluid.layers.fill_constant(shape=[16, 32], dtype='int64', value=3)
              x3 = fluid.layers.fill_constant(shape=[16, 32], dtype='int64', value=0)
  
              # Sum of multiple Tensors, the result is stored to a new Variable sum0 (sum0=x0+x1+x2, the value is [[6, ..., 6], ..., [6, ..., 6]])
              sum0 = fluid.layers.sums(input=[x0, x1, x2])
  
              # Sum of multiple Tensors, sum1 and x3 represents the same Variable (x3=x0+x1+x2, the value is [[6, ..., 6], ..., [6, ..., 6]])
              sum1 = fluid.layers.sums(input=[x0, x1, x2], out=x3)
      """
      check_type(input, 'input', (Variable, tuple, list), 'sums')
      if isinstance(input, list) or isinstance(input, tuple):
          for input_section in input:
              check_variable_and_dtype(input_section, "input", \
                      ['float16', 'float32', 'float64', 'int32', 'int64'], 'sums')
      else:
          check_variable_and_dtype(input, "input", \
                  ['float16', 'float32', 'float64', 'int32', 'int64'], 'sums')
  
      helper = LayerHelper('sum', **locals())
      if out is None:
          out = helper.create_variable_for_type_inference(
              dtype=helper.input_dtype())
      else:
          check_variable_and_dtype(
              out, "out", ['float32', 'float64', 'int32', 'int64'], 'sums')
  
      helper.append_op(
          type='sum',
          inputs={'X': input},
          outputs={'Out': out},
          attrs={'use_mkldnn': False})
      return out
function_tokens: def sums ( input , out = None ) : check_type ( input , 'input' , ( Variable , tuple , list ) , 'sums' ) if isinstance ( input , list ) or isinstance ( input , tuple ) : for input_section in input : check_variable_and_dtype ( input_section , "input" , [ 'float16' , 'float32' , 'float64' , 'int32' , 'int64' ] , 'sums' ) else : check_variable_and_dtype ( input , "input" , [ 'float16' , 'float32' , 'float64' , 'int32' , 'int64' ] , 'sums' ) helper = LayerHelper ( 'sum' , * * locals ( ) ) if out is None : out = helper . create_variable_for_type_inference ( dtype = helper . input_dtype ( ) ) else : check_variable_and_dtype ( out , "out" , [ 'float32' , 'float64' , 'int32' , 'int64' ] , 'sums' ) helper . append_op ( type = 'sum' , inputs = { 'X' : input } , outputs = { 'Out' : out } , attrs = { 'use_mkldnn' : False } ) return out