code: def max_pool2d(
      self,
      kernel_size,
      padding=0,
      stride=None,
      dilation=1,
      ceil_mode=False,
      return_indices=False,
  ):
      """Applies a 2D max pooling over an input signal composed of several
      input planes.
      """
      max_input = self.clone()
      max_input.data, output_size = _pool2d_reshape(
          self.data,
          kernel_size,
          padding=padding,
          stride=stride,
          dilation=dilation,
          ceil_mode=ceil_mode,
          # padding with extremely negative values to avoid choosing pads.
          # The magnitude of this value should not be too large because
          # multiplication can otherwise fail.
          pad_value=(-(2**24)),
          # TODO: Find a better solution for padding with max_pooling
      )
      max_vals, argmax_vals = max_input.max(dim=-1, one_hot=True)
      max_vals = max_vals.view(output_size)
      if return_indices:
          if isinstance(kernel_size, int):
              kernel_size = (kernel_size, kernel_size)
          argmax_vals = argmax_vals.view(output_size + kernel_size)
          return max_vals, argmax_vals
      return max_vals
  
file_path: CrypTen/crypten/common/functions/pooling.py
imports: import math
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: max_pool2d(kernel_size, padding, stride, dilation, ceil_mode, return_indices) and returns: max_vals, max_vals,  argmax_vals