code: def convert_SelectItem(
      func, opset_version, input_names, output_names, context
  ):
      gb = onnx_helper.GraphBuilder()
  
      if opset_version >= 11:
          t = gb.op("Unsqueeze", [input_names[1]], axes=[1])
          out = gb.op("GatherElements", [input_names[0], t], axis=1)
          gb.op("Squeeze", [out], axes=[1])
      else:
          data, target_idxs = input_names
          target_idxs = gb.op(
              "Cast",
              [target_idxs],
              to=NP_TYPE_TO_TENSOR_TYPE[np.dtype("int64")],
          )
          n_rows = gb.op("Shape", [target_idxs])
  
          # This is an equivalent of using Range.
          one_1 = onnx.helper.make_tensor(
              "one_1", onnx.TensorProto.FLOAT, [1], [1]
          )
          ones = gb.op("ConstantOfShape", [n_rows], value=one_1)
          row_idxs = gb.op("Squeeze", [gb.op("NonZero", [ones])])
  
          data_shape = gb.op("Shape", [data])
          one_2 = context.add_const(np.array([1]), "one_2")
          n_cols = gb.op("Gather", [data_shape, one_2], axis=0)
  
          data = gb.op("Squeeze", [gb.op("Flatten", [data], axis=2)])
          target_idxs = gb.op(
              "Add", [target_idxs, gb.op("Mul", [row_idxs, n_cols])]
          )
          gb.op("Gather", [data, target_idxs], axis=0)
  
      return gb.nodes(output_names)
  
imports: import warnings
  import chainer
  import numpy
  import onnx
  from onnx.mapping import NP_TYPE_TO_TENSOR_TYPE
  from onnx_chainer.functions.opset_version import support
  from onnx_chainer import onnx_helper
label_desc: Use image node_id 8 for calling a global function with example usage: convert_SelectItem(func, opset_version, input_names, output_names, context) and returns: gb