parameters: (input, dim=None, keep_dim=False, name=None)
return_statement: return out
docstring: Computes the maximum of tensor elements over the given dimension.
  
      Args:
          input (Variable): The input variable which is a Tensor, the data type is float32,
              float64, int32, int64.
          dim (list|int, optional): The dimension along which the maximum is computed.
              If :attr:`None`, compute the maximum over all elements of
              :attr:`input` and return a Tensor variable with a single element,
              otherwise must be in the range :math:`[-rank(input), rank(input))`.
              If :math:`dim[i] < 0`, the dimension to reduce is :math:`rank + dim[i]`.
          keep_dim (bool, optional): Whether to reserve the reduced dimension in the
              output Tensor. The result tensor will have one fewer dimension
              than the :attr:`input` unless :attr:`keep_dim` is true, default
              value is False.
          name(str, optional): The default value is None.  Normally there is no need for
              user to set this property.  For more information, please refer to :ref:`api_guide_Name`
  
      Returns:
          Variable: Tensor, results of maximum on the specified dim of input tensor,
          it's data type is the same as input's Tensor.
  
      Examples:
          .. code-block:: python
  
              import paddle.fluid as fluid
              import paddle
              paddle.enable_static()
              # x is a Tensor variable with following elements:
              #    [[0.2, 0.3, 0.5, 0.9]
              #     [0.1, 0.2, 0.6, 0.7]]
              # Each example is followed by the corresponding output tensor.
              x = fluid.data(name='x', shape=[2, 4], dtype='float32')
              fluid.layers.reduce_max(x)  # [0.9]
              fluid.layers.reduce_max(x, dim=0)  # [0.2, 0.3, 0.6, 0.9]
              fluid.layers.reduce_max(x, dim=-1)  # [0.9, 0.7]
              fluid.layers.reduce_max(x, dim=1, keep_dim=True)  # [[0.9], [0.7]]
  
              # y is a Tensor variable with shape [2, 2, 2] and elements as below:
              #      [[[1.0, 2.0], [3.0, 4.0]],
              #      [[5.0, 6.0], [7.0, 8.0]]]
              # Each example is followed by the corresponding output tensor.
              y = fluid.data(name='y', shape=[2, 2, 2], dtype='float32')
              fluid.layers.reduce_max(y, dim=[1, 2]) # [4.0, 8.0]
              fluid.layers.reduce_max(y, dim=[0, 1]) # [7.0, 8.0]
function: def reduce_max(input, dim=None, keep_dim=False, name=None):
      """
  
      Computes the maximum of tensor elements over the given dimension.
  
      Args:
          input (Variable): The input variable which is a Tensor, the data type is float32,
              float64, int32, int64.
          dim (list|int, optional): The dimension along which the maximum is computed.
              If :attr:`None`, compute the maximum over all elements of
              :attr:`input` and return a Tensor variable with a single element,
              otherwise must be in the range :math:`[-rank(input), rank(input))`.
              If :math:`dim[i] < 0`, the dimension to reduce is :math:`rank + dim[i]`.
          keep_dim (bool, optional): Whether to reserve the reduced dimension in the
              output Tensor. The result tensor will have one fewer dimension
              than the :attr:`input` unless :attr:`keep_dim` is true, default
              value is False.
          name(str, optional): The default value is None.  Normally there is no need for
              user to set this property.  For more information, please refer to :ref:`api_guide_Name`
  
      Returns:
          Variable: Tensor, results of maximum on the specified dim of input tensor,
          it's data type is the same as input's Tensor.
  
      Examples:
          .. code-block:: python
  
              import paddle.fluid as fluid
              import paddle
              paddle.enable_static()
              # x is a Tensor variable with following elements:
              #    [[0.2, 0.3, 0.5, 0.9]
              #     [0.1, 0.2, 0.6, 0.7]]
              # Each example is followed by the corresponding output tensor.
              x = fluid.data(name='x', shape=[2, 4], dtype='float32')
              fluid.layers.reduce_max(x)  # [0.9]
              fluid.layers.reduce_max(x, dim=0)  # [0.2, 0.3, 0.6, 0.9]
              fluid.layers.reduce_max(x, dim=-1)  # [0.9, 0.7]
              fluid.layers.reduce_max(x, dim=1, keep_dim=True)  # [[0.9], [0.7]]
  
              # y is a Tensor variable with shape [2, 2, 2] and elements as below:
              #      [[[1.0, 2.0], [3.0, 4.0]],
              #      [[5.0, 6.0], [7.0, 8.0]]]
              # Each example is followed by the corresponding output tensor.
              y = fluid.data(name='y', shape=[2, 2, 2], dtype='float32')
              fluid.layers.reduce_max(y, dim=[1, 2]) # [4.0, 8.0]
              fluid.layers.reduce_max(y, dim=[0, 1]) # [7.0, 8.0]
      """
      helper = LayerHelper('reduce_max', **locals())
      out = helper.create_variable_for_type_inference(dtype=helper.input_dtype())
      if dim is not None and not isinstance(dim, list):
          dim = [dim]
      helper.append_op(
          type='reduce_max',
          inputs={'X': input},
          outputs={'Out': out},
          attrs={
              'dim': dim if dim != None and dim != [] else [0],
              'keep_dim': keep_dim,
              'reduce_all': True if dim == None or dim == [] or
              len(dim) == len(input.shape) else False
          })
      return out
function_tokens: def reduce_max ( input , dim = None , keep_dim = False , name = None ) : helper = LayerHelper ( 'reduce_max' , * * locals ( ) ) out = helper . create_variable_for_type_inference ( dtype = helper . input_dtype ( ) ) if dim is not None and not isinstance ( dim , list ) : dim = [ dim ] helper . append_op ( type = 'reduce_max' , inputs = { 'X' : input } , outputs = { 'Out' : out } , attrs = { 'dim' : dim if dim != None and dim != [ ] else [ 0 ] , 'keep_dim' : keep_dim , 'reduce_all' : True if dim == None or dim == [ ] or len ( dim ) == len ( input . shape ) else False } ) return out