parameters: (x, axis=None, keepdim=False, dtype="int64", name=None)
return_statement: return out
docstring: This OP computes the indices of the max elements of the input tensor's
      element along the provided axis.
  
      Args:
          x(Tensor): An input N-D Tensor with type float32, float64, int16,
              int32, int64, uint8.
          axis(int, optional): Axis to compute indices along. The effective range
              is [-R, R), where R is x.ndim. when axis < 0, it works the same way
              as axis + R. Default is None, the input `x` will be into the flatten tensor, and selecting the min value index.
          keepdim(bool, optional): Keep the axis that selecting max. The defalut value is False.
          dtype(str|np.dtype, optional): Data type of the output tensor which can
                      be int32, int64. The default value is 'int64', and it will
                      return the int64 indices.
          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:
          Tensor, return the tensor of `int32` if set :attr:`dtype` is `int32`, otherwise return the tensor of `int64`
  
      Examples:
          .. code-block:: python
  
              import paddle
  
              x =  paddle.to_tensor([[5,8,9,5],
                                       [0,0,1,7],
                                       [6,9,2,4]])
              out1 = paddle.argmax(x)
              print(out1) # 2
              out2 = paddle.argmax(x, axis=1)
              print(out2) 
              # [2 3 1]
              out3 = paddle.argmax(x, axis=-1)
              print(out3) 
              # [2 3 1]
docstring_summary: This OP computes the indices of the max elements of the input tensor's
      element along the provided axis.
docstring_tokens: This OP computes the indices of the max elements of the input tensor s element along the provided axis .
function: def argmax(x, axis=None, keepdim=False, dtype="int64", name=None):
      """
      This OP computes the indices of the max elements of the input tensor's
      element along the provided axis.
  
      Args:
          x(Tensor): An input N-D Tensor with type float32, float64, int16,
              int32, int64, uint8.
          axis(int, optional): Axis to compute indices along. The effective range
              is [-R, R), where R is x.ndim. when axis < 0, it works the same way
              as axis + R. Default is None, the input `x` will be into the flatten tensor, and selecting the min value index.
          keepdim(bool, optional): Keep the axis that selecting max. The defalut value is False.
          dtype(str|np.dtype, optional): Data type of the output tensor which can
                      be int32, int64. The default value is 'int64', and it will
                      return the int64 indices.
          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:
          Tensor, return the tensor of `int32` if set :attr:`dtype` is `int32`, otherwise return the tensor of `int64`
  
      Examples:
          .. code-block:: python
  
              import paddle
  
              x =  paddle.to_tensor([[5,8,9,5],
                                       [0,0,1,7],
                                       [6,9,2,4]])
              out1 = paddle.argmax(x)
              print(out1) # 2
              out2 = paddle.argmax(x, axis=1)
              print(out2) 
              # [2 3 1]
              out3 = paddle.argmax(x, axis=-1)
              print(out3) 
              # [2 3 1]
      """
      if axis is not None and not isinstance(axis, int):
          raise TypeError(
              "The type of 'axis'  must be int or None in argmax, but received %s."
              % (type(axis)))
  
      if dtype is None:
          raise ValueError(
              "the value of 'dtype' in argmax could not be None, but received None"
          )
  
      var_dtype = convert_np_dtype_to_dtype_(dtype)
      flatten = False
      if axis is None:
          flatten = True
          axis = 0
  
      if in_dygraph_mode():
          out = _C_ops.arg_max(x, 'axis', axis, 'dtype', var_dtype, 'keepdims',
                               keepdim, 'flatten', flatten)
          return out
  
      helper = LayerHelper("argmax", **locals())
      check_variable_and_dtype(
          x, 'x', ['float32', 'float64', 'int16', 'int32', 'int64', 'uint8'],
          'paddle.argmax')
      check_dtype(var_dtype, 'dtype', ['int32', 'int64'], 'argmin')
      attrs = {}
      out = helper.create_variable_for_type_inference(var_dtype)
      attrs['keepdims'] = keepdim
      attrs['axis'] = axis
      attrs['flatten'] = flatten
      attrs['dtype'] = var_dtype
      helper.append_op(
          type='arg_max', inputs={'X': x}, outputs={'Out': [out]}, attrs=attrs)
      out.stop_gradient = True
      return out
function_tokens: def argmax ( x , axis = None , keepdim = False , dtype = "int64" , name = None ) : if axis is not None and not isinstance ( axis , int ) : raise TypeError ( "The type of 'axis'  must be int or None in argmax, but received %s." % ( type ( axis ) ) ) if dtype is None : raise ValueError ( "the value of 'dtype' in argmax could not be None, but received None" ) var_dtype = convert_np_dtype_to_dtype_ ( dtype ) flatten = False if axis is None : flatten = True axis = 0 if in_dygraph_mode ( ) : out = _C_ops . arg_max ( x , 'axis' , axis , 'dtype' , var_dtype , 'keepdims' , keepdim , 'flatten' , flatten ) return out helper = LayerHelper ( "argmax" , * * locals ( ) ) check_variable_and_dtype ( x , 'x' , [ 'float32' , 'float64' , 'int16' , 'int32' , 'int64' , 'uint8' ] , 'paddle.argmax' ) check_dtype ( var_dtype , 'dtype' , [ 'int32' , 'int64' ] , 'argmin' ) attrs = { } out = helper . create_variable_for_type_inference ( var_dtype ) attrs [ 'keepdims' ] = keepdim attrs [ 'axis' ] = axis attrs [ 'flatten' ] = flatten attrs [ 'dtype' ] = var_dtype helper . append_op ( type = 'arg_max' , inputs = { 'X' : x } , outputs = { 'Out' : [ out ] } , attrs = attrs ) out . stop_gradient = True return out