class_docstr: Perform average pooling. Currently only support 1D and 2D.
  
  Parameters
  ----------
  x: tensor<[n,C_in,*D_in],T>  (Required)
      *  ``D_in`` are spatial dimensions,  ``1 <= len(D_in) <= 2``
      *  ``C_in`` is the number of input channels or depth dimensions
      *  ``n``  is the batch dimension
  
  kernel_sizes: const tensor<[K],T> (Required)
      * The size of the window for each spatial dimension ``D_in`` of the input tensor.
      * ``K == len(D_in)``
  
  strides: const tensor<[S],i32> (Optional. Default to all 1s)
      * Stride along each of the spatial dimensions. ``S == len(D_in)``
  
  pad_type: const str (Required)
      * Must be one of the followings
          * ``valid``: No padding. This is equivalent to custom pad with ``pad[i] = 0, for all i``
          * ``custom``: Specify custom padding in the parameter pad. note that "same" padding is equivalent to custom padding with ``pad[2*i] + pad[2*i+1] = kernel_size[i]``
  
  pad: const<[P],i32> (Optional. Default to all 0s)
      *  pad represents the number of elements to pad before and after each dimension: `pad[2*i], pad[2*i+1]` are the pad size before and after spatial dimension i
      * ``P = 2 * len(D_in)``
      * ``pad`` should be specified if and only if ``pad_type == custom``
  
  exclude_padding_from_average: const tensor<[], bool> (Optional, Default to False)
      * If true, padded values (0s) are excluded from the denominator count when computing the average over the kernel window
  
  Returns
  -------
  tensor<[n, C_out,*D_out],T>
      * Same rank as ``x``
      * ``D_out[i] = floor[(D_in[i] + pad[2*i] + pad[2*i+1] - kernel_sizes[i]) / strides[i]] +1, for i = 0, .., len(D_in) - 1`` this is mathematically the same as (when all parameters involved are integers): ``D_out[i] = ceil [(D_in[i] + pad[2*i] + pad[2*i+1] - kernel_size[i] - 1) / stride[i]], for i = 0, .., len(D_in) - 1``
  
  Attributes
  ----------
  T: fp32
  
  See Also
  --------
  l2_pool, max_pool
code: def __init__(self, **kwargs):
      super(avg_pool, self).__init__(**kwargs)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/ops/defs/pool.py
imports: from coremltools.converters.mil.mil.ops.defs._utils import spatial_dimensions_out_shape
  from ._op_reqs import *
label_desc: Use image node_id 1 to create a new avg_pool object from inherited base classes: Pooling with example: obj = avg_pool()