code: def max_pool2d(
      x,
      kernel_size,
      stride=None,
      padding=0,
      return_mask=False,
      ceil_mode=False,
      data_format="NCHW",
      name=None,
  ):
      if stride is None:
          stride = kernel_size
      kernel_size = _broadcast_pooling_helper(
          kernel_size, "2d", name="kernel_size"
      )
      padding = _broadcast_pooling_helper(padding, "2d", name="padding")
  
      if data_format not in ["NCHW", "NHWC"]:
          raise ValueError(
              "Attr(data_format) should be 'NCHW' or 'NHWC'. Received "
              f"Attr(data_format): {data_format}."
          )
  
      if data_format == "NHWC" and return_mask:
          raise ValueError(
              "When setting return_mask to true, data_format must be set to NCHW in"
              " API:max_pool2d"
          )
  
      return ivy.max_pool2d(
          x,
          kernel_size,
          stride,
          padding,
          data_format=data_format,
          ceil_mode=ceil_mode,
      )
  
file_path: ivy/ivy/functional/frontends/paddle/nn/functional/pooling.py
imports: import ivy
  from ivy.func_wrapper import with_supported_dtypes
  from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
  from ivy.functional.ivy.experimental.layers import _broadcast_pooling_helper
  from ivy.func_wrapper import with_unsupported_dtypes
label_desc: Use image node_id 7 for calling a global function with example usage: max_pool2d(x, kernel_size, stride, padding, return_mask, ceil_mode, data_format, name) and returns: ivy