code: def save_to_json(self, filename):
      import google.protobuf.json_format as json_format
  
      json_str = json_format.MessageToJson(
          self.IR_graph, preserving_proto_field_name=True
      )
  
      with open(filename, "w") as of:
          of.write(json_str)
  
      print("IR network structure is saved as [{}].".format(filename))
  
      return json_str
  
file_path: MMdnn/mmdnn/conversion/common/DataStructure/parser.py
imports: import numpy
  import mmdnn.conversion.common.IR.graph_pb2
  from mmdnn.conversion.common.IR.graph_pb2 import NodeDef, GraphDef, DataType
label_desc: Use image node_id 7 for calling the Parser obj's underlying member method code with example usage: obj.save_to_json(filename) and returns: json_str