parameters: (x, index, axis=0, name=None)
return_statement: return out
docstring: Returns a new tensor which indexes the ``input`` tensor along dimension ``axis`` using 
      the entries in ``index`` which is a Tensor. The returned tensor has the same number 
      of dimensions as the original ``x`` tensor. The dim-th dimension has the same 
      size as the length of ``index``; other dimensions have the same size as in the ``x`` tensor. 
  
      Args:
          x (Tensor): The input Tensor to be operated. The data of ``x`` can be one of float32, float64, int32, int64.
          index (Tensor): The 1-D Tensor containing the indices to index. The data type of ``index`` must be int32 or int64.
          axis (int, optional): The dimension in which we index. Default: if None, the ``axis`` is 0.
          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: A Tensor with same data type as ``x``.
      
      Examples:
          .. code-block:: python
              
              import paddle
  
              x = paddle.to_tensor([[1.0, 2.0, 3.0, 4.0],
                                    [5.0, 6.0, 7.0, 8.0],
                                    [9.0, 10.0, 11.0, 12.0]])
              index = paddle.to_tensor([0, 1, 1], dtype='int32')
              out_z1 = paddle.index_select(x=x, index=index)
              #[[1. 2. 3. 4.]
              # [5. 6. 7. 8.]
              # [5. 6. 7. 8.]]
              out_z2 = paddle.index_select(x=x, index=index, axis=1)
              #[[ 1.  2.  2.]
              # [ 5.  6.  6.]
              # [ 9. 10. 10.]]
function: def index_select(x, index, axis=0, name=None):
      """
  
      Returns a new tensor which indexes the ``input`` tensor along dimension ``axis`` using 
      the entries in ``index`` which is a Tensor. The returned tensor has the same number 
      of dimensions as the original ``x`` tensor. The dim-th dimension has the same 
      size as the length of ``index``; other dimensions have the same size as in the ``x`` tensor. 
  
      Args:
          x (Tensor): The input Tensor to be operated. The data of ``x`` can be one of float32, float64, int32, int64.
          index (Tensor): The 1-D Tensor containing the indices to index. The data type of ``index`` must be int32 or int64.
          axis (int, optional): The dimension in which we index. Default: if None, the ``axis`` is 0.
          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: A Tensor with same data type as ``x``.
      
      Examples:
          .. code-block:: python
              
              import paddle
  
              x = paddle.to_tensor([[1.0, 2.0, 3.0, 4.0],
                                    [5.0, 6.0, 7.0, 8.0],
                                    [9.0, 10.0, 11.0, 12.0]])
              index = paddle.to_tensor([0, 1, 1], dtype='int32')
              out_z1 = paddle.index_select(x=x, index=index)
              #[[1. 2. 3. 4.]
              # [5. 6. 7. 8.]
              # [5. 6. 7. 8.]]
              out_z2 = paddle.index_select(x=x, index=index, axis=1)
              #[[ 1.  2.  2.]
              # [ 5.  6.  6.]
              # [ 9. 10. 10.]]
      """
  
      if in_dygraph_mode():
          return _C_ops.index_select(x, index, 'dim', axis)
  
      helper = LayerHelper("index_select", **locals())
      check_variable_and_dtype(x, 'x', ['float32', 'float64', 'int32', 'int64'],
                               'paddle.tensor.search.index_select')
      check_variable_and_dtype(index, 'index', ['int32', 'int64'],
                               'paddle.tensor.search.index_select')
  
      out = helper.create_variable_for_type_inference(x.dtype)
  
      helper.append_op(
          type='index_select',
          inputs={'X': x,
                  'Index': index},
          outputs={'Out': out},
          attrs={'dim': axis})
      return out
function_tokens: def index_select ( x , index , axis = 0 , name = None ) : if in_dygraph_mode ( ) : return _C_ops . index_select ( x , index , 'dim' , axis ) helper = LayerHelper ( "index_select" , * * locals ( ) ) check_variable_and_dtype ( x , 'x' , [ 'float32' , 'float64' , 'int32' , 'int64' ] , 'paddle.tensor.search.index_select' ) check_variable_and_dtype ( index , 'index' , [ 'int32' , 'int64' ] , 'paddle.tensor.search.index_select' ) out = helper . create_variable_for_type_inference ( x . dtype ) helper . append_op ( type = 'index_select' , inputs = { 'X' : x , 'Index' : index } , outputs = { 'Out' : out } , attrs = { 'dim' : axis } ) return out