class_docstr: Perform L2 pooling. Supports 1-D and 2-D pool.
  
  Parameters
  ----------
  x: tensor<[n,C_in,*D_in], T> (Required)
      * Only support 1d and 2d pooling.
      * See :py:class:`avg_pool`.
  
  kernel_sizes: const tensor<[K], T> (Required)
      * See :py:class:`avg_pool`.
  
  strides: const tensor<[S],i32> (Optional, default to all 1s)
      * See :py:class:`avg_pool`.
  
  pad_type: const str (Required)
      * See :py:class:`avg_pool`.
  
  pad: const<[P],i32> (Optional, default to all 0s)
      * See :py:class:`avg_pool`.
  
  Returns
  -------
  tensor<[n, C_out,*D_out], T>
      * See :py:class:`avg_pool`.
  
  Attributes
  ----------
  T: fp16, fp32
  
  See Also
  --------
  avg_pool, max_pool
class_docstr_tok: ["Perform","L2","pooling",".","Supports","1-D","and","2-D","pool",".","Parameters","--","--","--","--","--","x",":","tensor","<","[","n",",","C_in",",","*","D_in","]",",","T",">","(","Required",")","*","Only","support","1d","and","2d","pooling",".","*","See",":","py",":","class",":","`","avg_pool","`",".","kernel_sizes",":","const","tensor","<","[","K","]",",","T",">","(","Required",")","*","See",":","py",":","class",":","`","avg_pool","`",".","strides",":","const","tensor","<","[","S","]",",","i32",">","(","Optional",",","default","to","all","1s",")","*","See",":","py",":","class",":","`","avg_pool","`",".","pad_type",":","const","str","(","Required",")","*","See",":","py",":","class",":","`","avg_pool","`",".","pad",":","const","<","[","P","]",",","i32",">","(","Optional",",","default","to","all","0s",")","*","See",":","py",":","class",":","`","avg_pool","`",".","Returns","--","--","--","-","tensor","<","[","n",",","C_out",",","*","D_out","]",",","T",">","*","See",":","py",":","class",":","`","avg_pool","`",".","Attributes","--","--","--","--","--","T",":","fp16",",","fp32","See","Also","--","--","--","--","avg_pool",",","max_pool"]
code: def type_inference(self):
      if self.x.rank - 2 > 2:
          msg = (
              "l2_pool only supports rank 1 or 2. Got rank: {}".format(
                  self.x.rank - 2
              )
          )
          raise ValueError(msg)
      return super().type_inference()
  
file_path: coremltools/coremltools/converters/mil/mil/ops/defs/iOS15/pool.py
imports: from coremltools.converters.mil.mil import Operation, types
  from coremltools.converters.mil.mil.block import curr_opset_version
  from coremltools.converters.mil.mil.input_type import DefaultInputs, InputSpec, TensorInputType
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from coremltools.converters.mil.mil.ops.defs._utils import spatial_dimensions_out_shape
  from coremltools.converters.mil.mil.ops.defs.iOS15 import _IOS15_TARGET
label_desc: Use image node_id 1 for calling the l2_pool obj's underlying member method code with example usage: obj.type_inference() and returns: super