code: def convert_onnx(net, path_module, output, opset=11, simplify=False):
      assert isinstance(net, torch.nn.Module)
      img = np.random.randint(
          0, 255, size=(112, 112, 3), dtype=np.int32
      )
      img = img.astype(np.float)
      img = (img / 255.0 - 0.5) / 0.5  # torch style norm
      img = img.transpose((2, 0, 1))
      img = torch.from_numpy(img).unsqueeze(0).float()
  
      weight = torch.load(path_module)
      net.load_state_dict(weight)
      net.eval()
      torch.onnx.export(
          net,
          img,
          output,
          keep_initializers_as_inputs=False,
          verbose=False,
          opset_version=opset,
      )
      model = onnx.load(output)
      graph = model.graph
      graph.input[0].type.tensor_type.shape.dim[0].dim_param = "None"
      if simplify:
          from onnxsim import simplify
  
          model, check = simplify(model)
          assert check, "Simplified ONNX model could not be validated"
      onnx.save(model, output)
  
label_desc: Use image node_id 1 for calling a global function with example usage: convert_onnx(net, path_module, output, opset, simplify) without return types