class_docstr: Serialize and deserialize the ONNX textual representation.
class_docstr_tok: ["Serialize","and","deserialize","the","ONNX","textual","representation","."]
code: def deserialize_proto(self, serialized: bytes, proto):
      text = serialized.decode("utf-8")
      if isinstance(proto, onnx.ModelProto):
          return onnx.parser.parse_model(text)
      if isinstance(proto, onnx.GraphProto):
          return onnx.parser.parse_graph(text)
      if isinstance(proto, onnx.FunctionProto):
          return onnx.parser.parse_function(text)
      if isinstance(proto, onnx.NodeProto):
          return onnx.parser.parse_node(text)
      raise ValueError(f"Unsupported proto type: {type(proto)}")
  
file_path: onnx/onnx/test/serialization_test.py
imports: import os
  import tempfile
  import unittest
  import onnx
label_desc: Use image node_id 2 for calling the _OnnxTestTextualSerializer obj's underlying member method code with example usage: obj.deserialize_proto(serialized, proto) and returns: onnx, onnx, onnx, onnx