docstr: Serialize model to JSON message 
docstr_tok: ["Serialize","model","to","JSON","message"]
code: def to_json(self):
      """Serialize model to JSON message"""
      import torch  # pylint: disable=import-outside-toplevel,import-error
  
      json_model = {
          "signature": "netron:pytorch",
          "format": "TorchScript v" + torch.__version__,
          "graphs": [self.graph.to_json()],
      }
      return json_model
  
imports: import json
  import os
label_desc: Use image node_id 2 for calling the _Model obj's underlying member method code with example usage: obj.to_json() and returns: json_model