code: def max_pool(inputs, prev_modules, attrs, outputs):
      # extract attributes
      auto_pad = attrs.get("auto_pad", "NOTSET")
      kernelW, kernelH = map(int, attrs.get("kernel_shape")[:2])
      strideW, strideH = map(int, attrs.get("strides", (1, 1))[:2])
      dilationW, dilationH = map(
          int, attrs.get("dilations", (1, 1))[:2]
      )
      padW, padH = map(int, attrs.get("pads", (0, 0))[:2])
      ceil_mode = True if (attrs.get("ceil_mode", 0) != 0) else False
      storage_order = int(attrs.get("storage_order", 0))
      # extract inputs
      _, data_tensor_shape = inputs[0]
      input_width, input_height = data_tensor_shape[-2:]
      # calc output tensor shape
      output_width = calc_output_shape(
          input_width,
          kernelW,
          padding=padW,
          stride=strideW,
          dilation=dilationW,
          ceil_mode=ceil_mode,
      )
      output_height = calc_output_shape(
          input_height,
          kernelH,
          padding=padH,
          stride=strideH,
          dilation=dilationH,
          ceil_mode=ceil_mode,
      )
      out_tensor_shape_list = list(data_tensor_shape)
      out_tensor_shape_list[2] = output_height
      out_tensor_shape_list[3] = output_width
      out_tensor_shape = tuple(out_tensor_shape_list)
      # create module node
      module = SpatialMaxPooling(
          kw=kernelW,
          kh=kernelH,
          dw=strideW,
          dh=strideH,
          pad_w=padW,
          pad_h=padH,
          to_ceil=ceil_mode,
      )(prev_modules[0])
      return module, [out_tensor_shape]
  
file_path: BigDL/python/dllib/src/bigdl/dllib/contrib/onnx/ops_converter.py
imports: from bigdl.dllib.nn.layer import SpatialAveragePooling, SpatialBatchNormalization
  from bigdl.dllib.nn.layer import SpatialConvolution, SpatialMaxPooling, JoinTable
  from bigdl.dllib.nn.layer import ReLU, SoftMax, CAddTable, Unsqueeze
  from bigdl.dllib.nn.onnx.layer import Constant, Gather, Gemm, Shape, Reshape
  from .converter_utils import *
label_desc: Use image node_id 8 for calling a global function with example usage: max_pool(inputs, prev_modules, attrs, outputs) and returns: module,  list