code: def test_max_poll(self):
      kernel_width, kernel_height = 2, 2
      stride_width, stride_height = 1, 1
      pad_width, pad_height = 0, 0
      ceil_mode = 0
      input_shape = [1, 3, 224, 224]
      output_shape = [1, 3, 223, 223]
      input_x = np.random.random(input_shape)
  
      # Create one output (ValueInfoProto)
      X = onnx.helper.make_tensor_value_info(
          "X", onnx.TensorProto.FLOAT, input_shape
      )
      Y = onnx.helper.make_tensor_value_info(
          "Y", onnx.TensorProto.FLOAT, output_shape
      )
  
      maxpool_node = onnx.helper.make_node(
          op_type="MaxPool",
          inputs=["X"],
          outputs=["Y"],
          kernel_shape=(kernel_width, kernel_height),
      )
  
      # Create the graph (GraphProto)
      onnx_graph = onnx.helper.make_graph(
          nodes=[maxpool_node],
          name="test-maxpool",
          inputs=[X],
          outputs=[Y],
      )
  
      # Create the model (ModelProto)
      onnx_model = onnx.helper.make_model(
          onnx_graph, producer_name="ONNX"
      )
      onnx.checker.check_model(onnx_model)
  
      loaded_model = load_model_proto(onnx_model)
      bigdl_model = SpatialMaxPooling(
          kw=kernel_width,
          kh=kernel_height,
          dw=stride_width,
          dh=stride_height,
          pad_w=pad_width,
          pad_h=pad_height,
          to_ceil=False if ceil_mode == 0 else True,
      )
  
      loaded_out = loaded_model.forward(input_x)
      expected_out = bigdl_model.forward(input_x)
  
      assert np.array_equal(expected_out, loaded_out)
  
imports: import onnx
  import pytest
  import numpy
  from bigdl.dllib.contrib.onnx.onnx_loader import load_model_proto
  from bigdl.dllib.nn.layer import CAddTable, JoinTable, ReLU
  from bigdl.dllib.nn.layer import SoftMax, SpatialAveragePooling, SpatialBatchNormalization
  from bigdl.dllib.nn.layer import SpatialConvolution, SpatialMaxPooling
  from bigdl.dllib.nn.layer import Unsqueeze
  from bigdl.dllib.nn.onnx.layer import Gemm, Reshape, Shape
label_desc: Use image node_id 1 for calling the TestMaxPool obj's underlying member method code with example usage: obj.test_max_poll() without return types