code: def test_gather(self):
      axis = 0
      input_x = np.array(
          [
              [1.0, 1.2],
              [2.3, 3.4],
              [4.5, 5.7],
          ],
          dtype=float,
      )
      indices_val = np.array([[0, 1], [1, 2]], dtype=float)
      expected_out = np.array(
          [[[1, 1.2], [2.3, 3.4]], [[2.3, 3.4], [4.5, 5.7]]],
          dtype=float,
      )
      input_shape = input_x.shape
      indices_shape = indices_val.shape
      output_shape = [2, 2, 2]
  
      # Create one output (ValueInfoProto)
      data = onnx.helper.make_tensor_value_info(
          "data", onnx.TensorProto.FLOAT, input_shape
      )
      indices = onnx.helper.make_tensor_value_info(
          "indices", onnx.TensorProto.FLOAT, indices_shape
      )
      Y = onnx.helper.make_tensor_value_info(
          "Y", onnx.TensorProto.FLOAT, output_shape
      )
  
      init_indices = onnx.helper.make_tensor(
          name="indices",
          data_type=onnx.TensorProto.FLOAT,
          dims=indices_shape,
          vals=indices_val.flatten().tolist(),
      )
  
      gather_node = onnx.helper.make_node(
          op_type="Gather",
          inputs=["data", "indices"],
          outputs=["Y"],
          axis=axis,
      )
  
      # Create the graph (GraphProto)
      onnx_graph = onnx.helper.make_graph(
          nodes=[gather_node],
          name="test-gather",
          inputs=[data, indices],
          outputs=[Y],
          initializer=[init_indices],
      )
  
      # 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)
      loaded_out = loaded_model.forward([input_x, indices_val])
  
      assert np.allclose(loaded_out, expected_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 TestGather obj's underlying member method code with example usage: obj.test_gather() without return types