docstr: ivy.Container instance method variant of `ivy.avg_pool2d`. This
  method simply wraps the function, and so the docstring for
  `ivy.avg_pool2d` also applies to this method with minimal changes.
  
  Parameters
  ----------
  x
      Input image *[batch_size,h,w,d_in]*.
  kernel
      The size of the window to take a max over.
  strides
      The stride of the sliding window for each dimension of input.
  padding
      "SAME" or "VALID" indicating the algorithm, or list indicating
      the per-dimension paddings.
  data_format
      "NHWC" or "NCHW". Defaults to "NHWC".
  count_include_pad
      Whether to include padding in the averaging calculation.
  ceil_mode
      Whether to use ceil or floor for creating the output shape.
  divisor_override
      If specified, it will be used as divisor,
      otherwise kernel_size will be used.
  out
      optional output array, for writing the result to. It must have a shape
      that the inputs broadcast to.
  
  Returns
  -------
  ret
      The result of the pooling operation.
  
  Examples
  --------
  >>> a = ivy.arange(12).reshape((2, 1, 3, 2))
  >>> b = ivy.arange(48).reshape((2, 4, 3, 2))
  >>> x = ivy.Container({'a': a, 'b': b})
  >>> y = x.avg_pool2d(2, 1, "SAME")
  >>> print(y)
  {
      a: (<class ivy.data_classes.array.array.Array> shape=[2, 1, 3, 2]),
      b: (<class ivy.data_classes.array.array.Array> shape=[2, 4, 3, 2])
  }
docstr_tok: ["ivy.Container","instance","method","variant","of","`","ivy.avg_pool2d","`",".","This","method","simply","wraps","the","function",",","and","so","the","docstring","for","`","ivy.avg_pool2d","`","also","applies","to","this","method","with","minimal","changes",".","Parameters","--","--","--","--","--","x","Input","image","*","[","batch_size",",","h",",","w",",","d_in","]","*",".","kernel","The","size","of","the","window","to","take","a","max","over",".","strides","The","stride","of","the","sliding","window","for","each","dimension","of","input",".","padding","``","SAME","''","or","``","VALID","''","indicating","the","algorithm",",","or","list","indicating","the","per-dimension","paddings",".","data_format","``","NHWC","''","or","``","NCHW","''",".","Defaults","to","``","NHWC","''",".","count_include_pad","Whether","to","include","padding","in","the","averaging","calculation",".","ceil_mode","Whether","to","use","ceil","or","floor","for","creating","the","output","shape",".","divisor_override","If","specified",",","it","will","be","used","as","divisor",",","otherwise","kernel_size","will","be","used",".","out","optional","output","array",",","for","writing","the","result","to",".","It","must","have","a","shape","that","the","inputs","broadcast","to",".","Returns","--","--","--","-","ret","The","result","of","the","pooling","operation",".","Examples","--","--","--","--",">",">",">","a","=","ivy.arange","(","12",")",".reshape","(","(","2",",","1",",","3",",","2",")",")",">",">",">","b","=","ivy.arange","(","48",")",".reshape","(","(","2",",","4",",","3",",","2",")",")",">",">",">","x","=","ivy.Container","(","{","'","a","'",":","a",",","'","b","'",":","b","}",")",">",">",">","y","=","x.avg_pool2d","(","2",",","1",",","``","SAME","''",")",">",">",">","print","(","y",")","{","a",":","(","<","class","ivy.data_classes.array.array.Array",">","shape=","[","2",",","1",",","3",",","2","]",")",",","b",":","(","<","class","ivy.data_classes.array.array.Array",">","shape=","[","2",",","4",",","3",",","2","]",")","}"]
code: def avg_pool2d(
      self: ivy.Container,
      kernel: Union[int, Tuple[int], Tuple[int, int], ivy.Container],
      strides: Union[int, Tuple[int], Tuple[int, int], ivy.Container],
      padding: Union[str, ivy.Container],
      /,
      *,
      data_format: Union[str, ivy.Container] = "NHWC",
      count_include_pad: Union[bool, ivy.Container] = False,
      ceil_mode: Union[bool, ivy.Container] = False,
      divisor_override: Optional[Union[int, ivy.Container]] = None,
      key_chains: Optional[
          Union[List[str], Dict[str, str], ivy.Container]
      ] = None,
      to_apply: Union[bool, ivy.Container] = True,
      prune_unapplied: Union[bool, ivy.Container] = False,
      map_sequences: Union[bool, ivy.Container] = False,
      out: Optional[ivy.Container] = None,
  ) -> ivy.Container:
      """ivy.Container instance method variant of `ivy.avg_pool2d`. This
      method simply wraps the function, and so the docstring for
      `ivy.avg_pool2d` also applies to this method with minimal changes.
  
      Parameters
      ----------
      x
          Input image *[batch_size,h,w,d_in]*.
      kernel
          The size of the window to take a max over.
      strides
          The stride of the sliding window for each dimension of input.
      padding
          "SAME" or "VALID" indicating the algorithm, or list indicating
          the per-dimension paddings.
      data_format
          "NHWC" or "NCHW". Defaults to "NHWC".
      count_include_pad
          Whether to include padding in the averaging calculation.
      ceil_mode
          Whether to use ceil or floor for creating the output shape.
      divisor_override
          If specified, it will be used as divisor,
          otherwise kernel_size will be used.
      out
          optional output array, for writing the result to. It must have a shape
          that the inputs broadcast to.
  
      Returns
      -------
      ret
          The result of the pooling operation.
  
      Examples
      --------
      >>> a = ivy.arange(12).reshape((2, 1, 3, 2))
      >>> b = ivy.arange(48).reshape((2, 4, 3, 2))
      >>> x = ivy.Container({'a': a, 'b': b})
      >>> y = x.avg_pool2d(2, 1, "SAME")
      >>> print(y)
      {
          a: (<class ivy.data_classes.array.array.Array> shape=[2, 1, 3, 2]),
          b: (<class ivy.data_classes.array.array.Array> shape=[2, 4, 3, 2])
      }
      """
      return self.static_avg_pool2d(
          self,
          kernel,
          strides,
          padding,
          data_format=data_format,
          count_include_pad=count_include_pad,
          ceil_mode=ceil_mode,
          divisor_override=divisor_override,
          key_chains=key_chains,
          to_apply=to_apply,
          prune_unapplied=prune_unapplied,
          map_sequences=map_sequences,
          out=out,
      )
  
imports: from typing import Optional, Union, List, Dict, Tuple, Literal, Sequence, Callable
  import ivy
  from ivy.data_classes.container.base import ContainerBase
label_desc: Use image node_id 10 for calling the _ContainerWithLayersExperimental obj's underlying member method code with example usage: obj.avg_pool2d() and returns: self