docstr: ivy.Container instance method variant of `ivy.max_pool2d`. This
  method simply wraps the function, and so the docstring for
  `ivy.max_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".
  dilaton
      The stride between elements within a sliding window, must be > 0.
  ceil_mode
      If True, ceil is used instead of floor to compute the output shape.
      This ensures that every element is covered by a sliding window.
  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(24.).reshape((1, 2, 3, 4))
  >>> b = ivy.arange(48.).reshape((2, 4, 3, 2))
  >>> x = ivy.Container(a=a, b=b)
  >>> y = x.max_pool2d(3, 1, "VALID")
  >>> print(y)
  {
      a: ivy.array([], shape=(1, 0, 1, 4)),
      b: ivy.array([[[[16., 17.]],
                     [[22., 23.]]],
                   [[[40., 41.]],
                     [[46., 47.]]]])
  }
docstr_tok: ["ivy.Container","instance","method","variant","of","`","ivy.max_pool2d","`",".","This","method","simply","wraps","the","function",",","and","so","the","docstring","for","`","ivy.max_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","''",".","dilaton","The","stride","between","elements","within","a","sliding","window",",","must","be",">","0.","ceil_mode","If","True",",","ceil","is","used","instead","of","floor","to","compute","the","output","shape",".","This","ensures","that","every","element","is","covered","by","a","sliding","window",".","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","(","24",".",")",".reshape","(","(","1",",","2",",","3",",","4",")",")",">",">",">","b","=","ivy.arange","(","48",".",")",".reshape","(","(","2",",","4",",","3",",","2",")",")",">",">",">","x","=","ivy.Container","(","a=a",",","b=b",")",">",">",">","y","=","x.max_pool2d","(","3",",","1",",","``","VALID","''",")",">",">",">","print","(","y",")","{","a",":","ivy.array","(","[","]",",","shape=","(","1",",","0",",","1",",","4",")",")",",","b",":","ivy.array","(","[","[","[","[","16.",",","17",".","]","]",",","[","[","22.",",","23",".","]","]","]",",","[","[","[","40.",",","41",".","]","]",",","[","[","46.",",","47",".","]","]","]","]",")","}"]
code: def max_pool2d(
      self: ivy.Container,
      kernel: Union[int, Tuple[int, ...], ivy.Container],
      strides: Union[int, Tuple[int, ...], ivy.Container],
      padding: Union[
          str, int, Tuple[int], List[Tuple[int, int]], ivy.Container
      ],
      /,
      *,
      data_format: Union[str, ivy.Container] = "NHWC",
      dilation: Union[int, Tuple[int, ...], ivy.Container] = 1,
      ceil_mode: Union[bool, ivy.Container] = False,
      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.max_pool2d`. This
      method simply wraps the function, and so the docstring for
      `ivy.max_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".
      dilaton
          The stride between elements within a sliding window, must be > 0.
      ceil_mode
          If True, ceil is used instead of floor to compute the output shape.
          This ensures that every element is covered by a sliding window.
      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(24.).reshape((1, 2, 3, 4))
      >>> b = ivy.arange(48.).reshape((2, 4, 3, 2))
      >>> x = ivy.Container(a=a, b=b)
      >>> y = x.max_pool2d(3, 1, "VALID")
      >>> print(y)
      {
          a: ivy.array([], shape=(1, 0, 1, 4)),
          b: ivy.array([[[[16., 17.]],
                         [[22., 23.]]],
                       [[[40., 41.]],
                         [[46., 47.]]]])
      }
      """
      return self.static_max_pool2d(
          self,
          kernel,
          strides,
          padding,
          data_format=data_format,
          dilation=dilation,
          ceil_mode=ceil_mode,
          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 4 for calling the _ContainerWithLayersExperimental obj's underlying member method code with example usage: obj.max_pool2d() and returns: self