code: def dump_pytorch_to_onnx(
      self, pytorch_model, input_shape_with_batch, input_data_with_batch
  ):
      import uuid
  
      tmp_dir = self.create_temp_dir()
      onnx_path = "%s/%s" % (tmp_dir, uuid.uuid4().hex + ".onnx")
      dummy_input = self._generate_pytorch_input(
          input_shape_with_batch, input_data_with_batch
      )
      torch.onnx.export(pytorch_model, dummy_input, onnx_path)
      print("Creating an Onnx model: " + onnx_path)
      return onnx_path
  
file_path: analytics-zoo/pyzoo/test/zoo/pipeline/utils/test_utils_onnx.py
imports: from __future__ import print_function
  import numpy
  import onnx
  import torch
  from zoo.pipeline.api.onnx.onnx_loader import OnnxLoader
  from .test_utils import ZooTestCase
  from bigdl.util.common import to_list
label_desc: Use image node_id 1 for calling the OnnxTestCase obj's underlying member method code with example usage: obj.dump_pytorch_to_onnx(pytorch_model, input_shape_with_batch, input_data_with_batch) and returns: onnx_path