parameters: (x, output_size, return_mask=False, name=None)
return_statement: return (pool_out, mask) if return_mask else pool_out
docstring: This operation applies a 3D adaptive max pooling on input tensor.
          See more details in :ref:`api_nn_pooling_AdaptiveMaxPool3d` .
  
          Args:
              x (Tensor): The input tensor of adaptive max pool3d operator, which is a 5-D tensor. The data type can be float32, float64.
              output_size (int|list|tuple): The pool kernel size. If pool kernel size is a tuple or list, it must contain three elements, (D, H, W). D, H and W can be either a int, or None which means the size will be the same as that of the input.
              return_mask (bool): If true, the index of max pooling point will be returned along with outputs. Default False.
              name(str, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default.
  
          Returns:
              Tensor: The output tensor of adaptive max pool3d result. The data type is same as input tensor.
  
          Examples:
              .. code-block:: python
  
                # adaptive max pool3d
                # suppose input data in the shape of [N, C, D, H, W], `output_size` is [l, m, n]
                # output shape is [N, C, l, m, n], adaptive pool divide D, H and W dimensions
                # of input data into m*n grids averagely and performs poolings in each
                # grid to get output.
                # adaptive max pool performs calculations as follow:
                #
                #     for i in range(l):
                #         for j in range(m):
                #             for k in range(n):
                #                 dstart = floor(i * D / l)
                #                 dend = ceil((i + 1) * D / l)
                #                 hstart = floor(i * H / m)
                #                 hend = ceil((i + 1) * H / m)
                #                 wstart = floor(i * W / n)
                #                 wend = ceil((i + 1) * W / n)
                #             output[:, :, i, j, k] = max(input[:, :, dstart: dend, hstart: hend, wstart: wend])
                #
                import paddle
                import numpy as np
  
                input_data = np.random.rand(2, 3, 8, 32, 32)
                x = paddle.to_tensor(input_data)
                # x.shape is [2, 3, 8, 32, 32]
                out = paddle.nn.functional.adaptive_max_pool3d(
                              x = x,
                              output_size=[3, 3, 3])
                # out.shape is [2, 3, 3, 3, 3]
docstring_summary: This operation applies a 3D adaptive max pooling on input tensor.
          See more details in :ref:`api_nn_pooling_AdaptiveMaxPool3d` .
docstring_tokens: This operation applies a 3D adaptive max pooling on input tensor . See more details in : ref : api_nn_pooling_AdaptiveMaxPool3d .
function: def adaptive_max_pool3d(x, output_size, return_mask=False, name=None):
      """
          This operation applies a 3D adaptive max pooling on input tensor.
          See more details in :ref:`api_nn_pooling_AdaptiveMaxPool3d` .
  
          Args:
              x (Tensor): The input tensor of adaptive max pool3d operator, which is a 5-D tensor. The data type can be float32, float64.
              output_size (int|list|tuple): The pool kernel size. If pool kernel size is a tuple or list, it must contain three elements, (D, H, W). D, H and W can be either a int, or None which means the size will be the same as that of the input.
              return_mask (bool): If true, the index of max pooling point will be returned along with outputs. Default False.
              name(str, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default.
  
          Returns:
              Tensor: The output tensor of adaptive max pool3d result. The data type is same as input tensor.
  
          Examples:
              .. code-block:: python
  
                # adaptive max pool3d
                # suppose input data in the shape of [N, C, D, H, W], `output_size` is [l, m, n]
                # output shape is [N, C, l, m, n], adaptive pool divide D, H and W dimensions
                # of input data into m*n grids averagely and performs poolings in each
                # grid to get output.
                # adaptive max pool performs calculations as follow:
                #
                #     for i in range(l):
                #         for j in range(m):
                #             for k in range(n):
                #                 dstart = floor(i * D / l)
                #                 dend = ceil((i + 1) * D / l)
                #                 hstart = floor(i * H / m)
                #                 hend = ceil((i + 1) * H / m)
                #                 wstart = floor(i * W / n)
                #                 wend = ceil((i + 1) * W / n)
                #             output[:, :, i, j, k] = max(input[:, :, dstart: dend, hstart: hend, wstart: wend])
                #
                import paddle
                import numpy as np
  
                input_data = np.random.rand(2, 3, 8, 32, 32)
                x = paddle.to_tensor(input_data)
                # x.shape is [2, 3, 8, 32, 32]
                out = paddle.nn.functional.adaptive_max_pool3d(
                              x = x,
                              output_size=[3, 3, 3])
                # out.shape is [2, 3, 3, 3, 3]
      """
  
      if not in_dygraph_mode():
          check_variable_and_dtype(x, 'x', ['float32', 'float64'],
                                   'adaptive_max_pool3d')
          check_type(return_mask, 'return_mask', bool, 'adaptive_max_pool3d')
          #check_type(output_size, 'pool_size', (int), 'adaptive_max_pool3d')
      _check_input(x, 5)
  
      in_l, in_h, in_w = x.shape[2:5]
      if isinstance(output_size, int):
          output_size = utils.convert_to_list(output_size, 3, 'output_size')
      else:
          output_size = list(output_size)
          if output_size[0] == None:
              output_size[0] = in_l
          if output_size[1] == None:
              output_size[1] = in_h
          if output_size[2] == None:
              output_size[2] = in_w
  
      if in_dygraph_mode():
          pool_out = _C_ops.max_pool3d_with_index(
              x, 'pooling_type', 'max', 'ksize', output_size, 'adaptive', True)
          return pool_out if return_mask else pool_out[0]
  
      l_type = 'max_pool3d_with_index'
  
      helper = LayerHelper(l_type, **locals())
      dtype = helper.input_dtype(input_param_name='x')
      pool_out = helper.create_variable_for_type_inference(dtype)
  
      mask = helper.create_variable_for_type_inference('int32')
      outputs = {"Out": pool_out, "Mask": mask}
  
      helper.append_op(
          type=l_type,
          inputs={"X": x},
          outputs=outputs,
          attrs={
              "pooling_type": 'max',
              "ksize": output_size,
              "adaptive": True,
          })
  
      return (pool_out, mask) if return_mask else pool_out
function_tokens: def adaptive_max_pool3d ( x , output_size , return_mask = False , name = None ) : if not in_dygraph_mode ( ) : check_variable_and_dtype ( x , 'x' , [ 'float32' , 'float64' ] , 'adaptive_max_pool3d' ) check_type ( return_mask , 'return_mask' , bool , 'adaptive_max_pool3d' ) #check_type(output_size, 'pool_size', (int), 'adaptive_max_pool3d') _check_input ( x , 5 ) in_l , in_h , in_w = x . shape [ 2 : 5 ] if isinstance ( output_size , int ) : output_size = utils . convert_to_list ( output_size , 3 , 'output_size' ) else : output_size = list ( output_size ) if output_size [ 0 ] == None : output_size [ 0 ] = in_l if output_size [ 1 ] == None : output_size [ 1 ] = in_h if output_size [ 2 ] == None : output_size [ 2 ] = in_w if in_dygraph_mode ( ) : pool_out = _C_ops . max_pool3d_with_index ( x , 'pooling_type' , 'max' , 'ksize' , output_size , 'adaptive' , True ) return pool_out if return_mask else pool_out [ 0 ] l_type = 'max_pool3d_with_index' helper = LayerHelper ( l_type , * * locals ( ) ) dtype = helper . input_dtype ( input_param_name = 'x' ) pool_out = helper . create_variable_for_type_inference ( dtype ) mask = helper . create_variable_for_type_inference ( 'int32' ) outputs = { "Out" : pool_out , "Mask" : mask } helper . append_op ( type = l_type , inputs = { "X" : x } , outputs = outputs , attrs = { "pooling_type" : 'max' , "ksize" : output_size , "adaptive" : True , } ) return ( pool_out , mask ) if return_mask else pool_out