code: def DnMaxPooling(
      input_tensor,
      pool_size=(2, 2),
      dim=2,
      padding="SAME",
      backend="tensorflow",
  ):
      op = None
  
      if backend == "keras":
          if dim == 2:
              return MaxPooling2D(pool_size=pool_size, padding=padding)(
                  input_tensor
              )
          if dim == 3:
              return MaxPooling3D(pool_size=pool_size, padding=padding)(
                  input_tensor
              )
  
      if backend == "tensorflow":
          if dim == 2:
              op = tf.nn.max_pool(
                  input_tensor,
                  ksize=[1] + list(pool_size) + [1],
                  strides=[1] + list(pool_size) + [1],
                  padding="SAME",
              )
          if dim == 3:
              op = tf.nn.max_pool3d(
                  input_tensor,
                  ksize=[1] + list(pool_size) + [1],
                  strides=[1] + list(pool_size) + [1],
                  padding="SAME",
              )
  
      if op is None:
          raise NotImplementedError
  
      return op
  
file_path: DeepNeuro/deepneuro/models/dn_ops.py
imports: import tensorflow
  from keras.layers import UpSampling2D, UpSampling3D, Conv3D, MaxPooling3D, Conv2D, MaxPooling2D, Activation, BatchNormalization, Dropout, ZeroPadding2D, ZeroPadding3D
  from deepneuro.models.ops import pixel_norm_2d, pixel_norm_3d, conv2d, conv3d, deconv2d, deconv3d, upscale2d
label_desc: Use image node_id 3 for calling a global function with example usage: DnMaxPooling(input_tensor, pool_size, dim, padding, backend) and returns: op, MaxPooling2D, MaxPooling3D