code: def save_caffe2_net(net, file, output_txt=False):
      with open(file, "wb") as f:
          f.write(net.SerializeToString())
      if output_txt:
          with open(file + "txt", "w") as f:
              f.write(str(net))
  
file_path: pytorch/caffe2/python/onnx/helper.py
imports: from caffe2.proto import caffe2_pb2
  from onnx.backend.base import namedtupledict
  from caffe2.python.onnx.workspace import Workspace
  import logging
  import time
label_desc: Use image node_id 4 for calling a global function with example usage: save_caffe2_net(net, file, output_txt) without return types