parameters: (input,
             pool_size=-1,
             pool_type="max",
             pool_stride=1,
             pool_padding=0,
             global_pooling=False,
             use_cudnn=True,
             ceil_mode=False,
             name=None,
             exclusive=True,
             data_format="NCDHW")
return_statement: return pool_out
docstring: ${comment}
  
      Args:
          input (Variable): The input tensor of pooling operator, which is a 5-D tensor with
                            shape [N, C, D, H, W]. The format of
                            input tensor is `"NCDHW"` or `"NDHWC"`, where `N` is batch size, `C` is
                            the number of channels, `D` is the depth of the feature,
                            `H` is the height of the feature, and `W` is the width
                            of the feature.
          pool_size (int|list|tuple): The pool kernel size. If pool kernel size
              is a tuple or list, it must contain three integers,
              (pool_size_Depth, pool_size_Height, pool_size_Width).
              Otherwise, the pool kernel size will be the cube of an int.
          pool_type (string): ${pooling_type_comment}
          pool_stride (string|int|list|tuple)): The pool padding. If `pool_padding` is a string, either 'VALID' or
              'SAME' which is the padding algorithm. If pool stride size is a tuple or list,
              it must contain three integers, `[stride_Depth, stride_Height, stride_Width]`.
              Otherwise, the pool stride size will be a cube of an int.
          pool_padding (int|list|tuple): The pool padding size. If pool padding size is a tuple or list,
              it could be in three forms: `[pad_depth, pad_height, pad_width]` or
              `[pad_depth_front, pad_depth_back, pad_height_top, pad_height_bottom, pad_width_left, pad_width_right]`,
              and when `data_format` is `"NCDHW"`, `pool_padding` can be in the form
              `[[0,0], [0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right]]`.
              when `data_format` is `"NDHWC"`, `pool_padding` can be in the form
              `[[0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right], [0,0]]`.
          global_pooling (bool): ${global_pooling_comment}
          use_cudnn (bool): ${use_cudnn_comment}
          ceil_mode (bool): ${ceil_mode_comment}
          name(str, optional): For detailed information, please refer
                               to :ref:`api_guide_Name`. Usually name is no need to set and
                               None by default.
          exclusive (bool): Whether to exclude padding points in average pooling
                            mode, default is true.
          data_format (string): The data format of the input and output data. An optional string from: `"NCDHW"`, `"NDHWC"`.
                  The default is `"NCDHW"`. When it is `"NCDHW"`, the data is stored in the order of:
                  `[batch_size, input_channels, input_depth, input_height, input_width]`.
  
      Returns:
          Variable: The output tensor of pooling result. The data type is same as input tensor.
  
      Raises:
          ValueError: If `pool_type` is not "max" nor "avg".
          ValueError: If `global_pooling` is False and `pool_size` is -1.
          TypeError: If `use_cudnn` is not a bool value.
          ValueError: If `data_format` is not "NCDHW" or "NDHWC".
          ValueError: If `pool_padding` is a string, but not "SAME" or "VALID".
          ValueError: If `pool_padding` is "VALID", but `ceil_mode` is True.
          ValueError: If `pool_padding` is a list or tuple, but the elements in the batch or channel dimensions are non-zero.
          ShapeError: If the input is not a 4-D or 5-D Tensor.
          ShapeError: If the dimension of input minus the size of `pool_stride` is not 2.
          ShapeError: If the size of `pool_size` and `pool_stride` is not equal.
          ShapeError: If the output's shape calculated is not greater than 0.
  
      Examples:
  
          .. code-block:: python
  
            import paddle.fluid as fluid
            import paddle
  
            paddle.enable_static()
  
            data = fluid.data(name='data', shape=[None, 3, 32, 32, 32], dtype='float32')
  
            # max pool3d
            pool3d = fluid.layers.pool3d(
              input = data,
              pool_size = 2,
              pool_type = "max",
              pool_stride = 1,
              global_pooling=False)
  
            # average pool3d
            pool3d = fluid.layers.pool3d(
              input = data,
              pool_size = 2,
              pool_type = "avg",
              pool_stride = 1,
              global_pooling=False)
  
            # global average pool3d
            pool3d = fluid.layers.pool3d(
              input = data,
              pool_size = 2,
              pool_type = "avg",
              pool_stride = 1,
              global_pooling=True)
  
            # example 1:
            # Attr(pool_padding) is a list with 6 elements, Attr(data_format) is "NCDHW".
            out_1 = fluid.layers.pool3d(
              input = data,
              pool_size = 2,
              pool_type = "avg",
              pool_stride = 1,
              pool_padding = [1, 2, 1, 0, 1, 2],
              global_pooling = False,
              data_format = "NCDHW")
  
            # example 2:
            # Attr(pool_padding) is a string, Attr(data_format) is "NCDHW".
            out_2 = fluid.layers.pool3d(
              input = data,
              pool_size = 3,
              pool_type = "avg",
              pool_stride = 1,
              pool_padding = "VALID",
              global_pooling = False,
              data_format = "NCDHW")
function: def pool3d(input,
             pool_size=-1,
             pool_type="max",
             pool_stride=1,
             pool_padding=0,
             global_pooling=False,
             use_cudnn=True,
             ceil_mode=False,
             name=None,
             exclusive=True,
             data_format="NCDHW"):
      """
  
      ${comment}
  
      Args:
          input (Variable): The input tensor of pooling operator, which is a 5-D tensor with
                            shape [N, C, D, H, W]. The format of
                            input tensor is `"NCDHW"` or `"NDHWC"`, where `N` is batch size, `C` is
                            the number of channels, `D` is the depth of the feature,
                            `H` is the height of the feature, and `W` is the width
                            of the feature.
          pool_size (int|list|tuple): The pool kernel size. If pool kernel size
              is a tuple or list, it must contain three integers,
              (pool_size_Depth, pool_size_Height, pool_size_Width).
              Otherwise, the pool kernel size will be the cube of an int.
          pool_type (string): ${pooling_type_comment}
          pool_stride (string|int|list|tuple)): The pool padding. If `pool_padding` is a string, either 'VALID' or
              'SAME' which is the padding algorithm. If pool stride size is a tuple or list,
              it must contain three integers, `[stride_Depth, stride_Height, stride_Width]`.
              Otherwise, the pool stride size will be a cube of an int.
          pool_padding (int|list|tuple): The pool padding size. If pool padding size is a tuple or list,
              it could be in three forms: `[pad_depth, pad_height, pad_width]` or
              `[pad_depth_front, pad_depth_back, pad_height_top, pad_height_bottom, pad_width_left, pad_width_right]`,
              and when `data_format` is `"NCDHW"`, `pool_padding` can be in the form
              `[[0,0], [0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right]]`.
              when `data_format` is `"NDHWC"`, `pool_padding` can be in the form
              `[[0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right], [0,0]]`.
          global_pooling (bool): ${global_pooling_comment}
          use_cudnn (bool): ${use_cudnn_comment}
          ceil_mode (bool): ${ceil_mode_comment}
          name(str, optional): For detailed information, please refer
                               to :ref:`api_guide_Name`. Usually name is no need to set and
                               None by default.
          exclusive (bool): Whether to exclude padding points in average pooling
                            mode, default is true.
          data_format (string): The data format of the input and output data. An optional string from: `"NCDHW"`, `"NDHWC"`.
                  The default is `"NCDHW"`. When it is `"NCDHW"`, the data is stored in the order of:
                  `[batch_size, input_channels, input_depth, input_height, input_width]`.
  
      Returns:
          Variable: The output tensor of pooling result. The data type is same as input tensor.
  
      Raises:
          ValueError: If `pool_type` is not "max" nor "avg".
          ValueError: If `global_pooling` is False and `pool_size` is -1.
          TypeError: If `use_cudnn` is not a bool value.
          ValueError: If `data_format` is not "NCDHW" or "NDHWC".
          ValueError: If `pool_padding` is a string, but not "SAME" or "VALID".
          ValueError: If `pool_padding` is "VALID", but `ceil_mode` is True.
          ValueError: If `pool_padding` is a list or tuple, but the elements in the batch or channel dimensions are non-zero.
          ShapeError: If the input is not a 4-D or 5-D Tensor.
          ShapeError: If the dimension of input minus the size of `pool_stride` is not 2.
          ShapeError: If the size of `pool_size` and `pool_stride` is not equal.
          ShapeError: If the output's shape calculated is not greater than 0.
  
      Examples:
  
          .. code-block:: python
  
            import paddle.fluid as fluid
            import paddle
  
            paddle.enable_static()
  
            data = fluid.data(name='data', shape=[None, 3, 32, 32, 32], dtype='float32')
  
            # max pool3d
            pool3d = fluid.layers.pool3d(
              input = data,
              pool_size = 2,
              pool_type = "max",
              pool_stride = 1,
              global_pooling=False)
  
            # average pool3d
            pool3d = fluid.layers.pool3d(
              input = data,
              pool_size = 2,
              pool_type = "avg",
              pool_stride = 1,
              global_pooling=False)
  
            # global average pool3d
            pool3d = fluid.layers.pool3d(
              input = data,
              pool_size = 2,
              pool_type = "avg",
              pool_stride = 1,
              global_pooling=True)
  
            # example 1:
            # Attr(pool_padding) is a list with 6 elements, Attr(data_format) is "NCDHW".
            out_1 = fluid.layers.pool3d(
              input = data,
              pool_size = 2,
              pool_type = "avg",
              pool_stride = 1,
              pool_padding = [1, 2, 1, 0, 1, 2],
              global_pooling = False,
              data_format = "NCDHW")
  
            # example 2:
            # Attr(pool_padding) is a string, Attr(data_format) is "NCDHW".
            out_2 = fluid.layers.pool3d(
              input = data,
              pool_size = 3,
              pool_type = "avg",
              pool_stride = 1,
              pool_padding = "VALID",
              global_pooling = False,
              data_format = "NCDHW")
  
      """
      if pool_type not in ["max", "avg"]:
          raise ValueError(
              "Unknown Attr(pool_type): '%s'. It can only be 'max' or 'avg'.",
              str(pool_type))
  
      if global_pooling is False and pool_size == -1:
          raise ValueError(
              "When Attr(global_pooling) is False, Attr(pool_size) must be passed "
              "and be a valid value. Received Attr(pool_size): %s." %
              str(pool_size))
  
      if not isinstance(use_cudnn, bool):
          raise TypeError("Attr(use_cudnn) should be True or False. Received "
                          "Attr(use_cudnn): %s. " % str(use_cudnn))
  
      if data_format not in ["NCDHW", "NDHWC"]:
          raise ValueError(
              "Attr(data_format) should be 'NCDHW' or 'NDHWC'. Received "
              "Attr(data_format): %s" % str(data_format))
  
      pool_size = utils.convert_to_list(pool_size, 3, 'pool_size')
      pool_stride = utils.convert_to_list(pool_stride, 3, 'pool_stride')
  
      def update_padding(padding, data_format):
          def is_list_or_tuple(ele):
              if isinstance(ele, (list, tuple)):
                  return True
              return False
  
          if is_list_or_tuple(padding) and len(padding) == 5:
              if is_list_or_tuple(padding[0]) and (data_format == "NCDHW"):
                  if not (padding[0] == [0, 0] and padding[1] == [0, 0]):
                      raise ValueError(
                          "Non-zero pool_padding(%s) in the batch or channel dimensions "
                          "is not supported." % str(padding))
                  padding = padding[2:5]
                  padding = [ele for a_list in padding for ele in a_list]
              elif is_list_or_tuple(padding[0]) and (data_format == "NDHWC"):
                  if not (padding[0] == [0, 0] and padding[4] == [0, 0]):
                      raise ValueError(
                          "Non-zero pool_padding(%s) in the batch or channel dimensions "
                          "is not supported." % str(padding))
                  padding = padding[1:4]
                  padding = [ele for a_list in padding for ele in a_list]
              padding = utils.convert_to_list(padding, 6, 'padding')
              if utils._is_symmetric_padding(padding, 3):
                  padding = [padding[0], padding[2], padding[4]]
  
          elif is_list_or_tuple(padding) and len(padding) == 6:
              padding = utils.convert_to_list(padding, 6, 'padding')
              if utils._is_symmetric_padding(padding, 3):
                  padding = [padding[0], padding[2], padding[4]]
          else:
              padding = utils.convert_to_list(padding, 3, 'padding')
  
          return padding
  
      padding_algorithm = "EXPLICIT"
      if isinstance(pool_padding, str):
          pool_padding = pool_padding.upper()
          if pool_padding not in ["SAME", "VALID"]:
              raise ValueError(
                  "Unknown Attr(pool_padding): '%s'. It can only be 'SAME' or 'VALID'."
                  % str(pool_padding))
          if pool_padding == "VALID":
              padding_algorithm = "VALID"
              pool_padding = [0, 0, 0]
              if ceil_mode != False:
                  raise ValueError(
                      "When Attr(pool_padding) is \"VALID\", ceil_mode must be False. "
                      "Received ceil_mode: True.")
          elif pool_padding == "SAME":
              padding_algorithm = "SAME"
              pool_padding = [0, 0, 0]
  
      pool_padding = update_padding(pool_padding, data_format)
  
      op_type = "pool3d"
      helper = LayerHelper(op_type, **locals())
      dtype = helper.input_dtype()
      pool_out = helper.create_variable_for_type_inference(dtype)
  
      helper.append_op(
          type=op_type,
          inputs={"X": input},
          outputs={"Out": pool_out},
          attrs={
              "pooling_type": pool_type,
              "ksize": pool_size,
              "global_pooling": global_pooling,
              "strides": pool_stride,
              "paddings": pool_padding,
              "padding_algorithm": padding_algorithm,
              "use_cudnn": use_cudnn,
              "ceil_mode": ceil_mode,
              "use_mkldnn": False,
              "exclusive": exclusive,
              "data_format": data_format,
          })
  
      return pool_out
function_tokens: def pool3d ( input , pool_size = - 1 , pool_type = "max" , pool_stride = 1 , pool_padding = 0 , global_pooling = False , use_cudnn = True , ceil_mode = False , name = None , exclusive = True , data_format = "NCDHW" ) : if pool_type not in [ "max" , "avg" ] : raise ValueError ( "Unknown Attr(pool_type): '%s'. It can only be 'max' or 'avg'." , str ( pool_type ) ) if global_pooling is False and pool_size == - 1 : raise ValueError ( "When Attr(global_pooling) is False, Attr(pool_size) must be passed " "and be a valid value. Received Attr(pool_size): %s." % str ( pool_size ) ) if not isinstance ( use_cudnn , bool ) : raise TypeError ( "Attr(use_cudnn) should be True or False. Received " "Attr(use_cudnn): %s. " % str ( use_cudnn ) ) if data_format not in [ "NCDHW" , "NDHWC" ] : raise ValueError ( "Attr(data_format) should be 'NCDHW' or 'NDHWC'. Received " "Attr(data_format): %s" % str ( data_format ) ) pool_size = utils . convert_to_list ( pool_size , 3 , 'pool_size' ) pool_stride = utils . convert_to_list ( pool_stride , 3 , 'pool_stride' ) def update_padding ( padding , data_format ) : def is_list_or_tuple ( ele ) : if isinstance ( ele , ( list , tuple ) ) : return True return False if is_list_or_tuple ( padding ) and len ( padding ) == 5 : if is_list_or_tuple ( padding [ 0 ] ) and ( data_format == "NCDHW" ) : if not ( padding [ 0 ] == [ 0 , 0 ] and padding [ 1 ] == [ 0 , 0 ] ) : raise ValueError ( "Non-zero pool_padding(%s) in the batch or channel dimensions " "is not supported." % str ( padding ) ) padding = padding [ 2 : 5 ] padding = [ ele for a_list in padding for ele in a_list ] elif is_list_or_tuple ( padding [ 0 ] ) and ( data_format == "NDHWC" ) : if not ( padding [ 0 ] == [ 0 , 0 ] and padding [ 4 ] == [ 0 , 0 ] ) : raise ValueError ( "Non-zero pool_padding(%s) in the batch or channel dimensions " "is not supported." % str ( padding ) ) padding = padding [ 1 : 4 ] padding = [ ele for a_list in padding for ele in a_list ] padding = utils . convert_to_list ( padding , 6 , 'padding' ) if utils . _is_symmetric_padding ( padding , 3 ) : padding = [ padding [ 0 ] , padding [ 2 ] , padding [ 4 ] ] elif is_list_or_tuple ( padding ) and len ( padding ) == 6 : padding = utils . convert_to_list ( padding , 6 , 'padding' ) if utils . _is_symmetric_padding ( padding , 3 ) : padding = [ padding [ 0 ] , padding [ 2 ] , padding [ 4 ] ] else : padding = utils . convert_to_list ( padding , 3 , 'padding' ) return padding padding_algorithm = "EXPLICIT" if isinstance ( pool_padding , str ) : pool_padding = pool_padding . upper ( ) if pool_padding not in [ "SAME" , "VALID" ] : raise ValueError ( "Unknown Attr(pool_padding): '%s'. It can only be 'SAME' or 'VALID'." % str ( pool_padding ) ) if pool_padding == "VALID" : padding_algorithm = "VALID" pool_padding = [ 0 , 0 , 0 ] if ceil_mode != False : raise ValueError ( "When Attr(pool_padding) is \"VALID\", ceil_mode must be False. " "Received ceil_mode: True." ) elif pool_padding == "SAME" : padding_algorithm = "SAME" pool_padding = [ 0 , 0 , 0 ] pool_padding = update_padding ( pool_padding , data_format ) op_type = "pool3d" helper = LayerHelper ( op_type , * * locals ( ) ) dtype = helper . input_dtype ( ) pool_out = helper . create_variable_for_type_inference ( dtype ) helper . append_op ( type = op_type , inputs = { "X" : input } , outputs = { "Out" : pool_out } , attrs = { "pooling_type" : pool_type , "ksize" : pool_size , "global_pooling" : global_pooling , "strides" : pool_stride , "paddings" : pool_padding , "padding_algorithm" : padding_algorithm , "use_cudnn" : use_cudnn , "ceil_mode" : ceil_mode , "use_mkldnn" : False , "exclusive" : exclusive , "data_format" : data_format , } ) return pool_out