class_docstr: Serialize and deserialize the ONNX textual representation.
class_docstr_tok: ["Serialize","and","deserialize","the","ONNX","textual","representation","."]
code: def serialize_proto(self, proto: _Proto) -> bytes:
      text = onnx.printer.to_text(proto)  # type: ignore[arg-type]
      return text.encode(_ENCODING)
  
imports: from __future__ import annotations
  import warnings
  import typing
  from typing import Any, Collection, Optional, Protocol, TypeVar
  import google.protobuf.json_format
  import google.protobuf.message
  import google.protobuf.text_format
  import onnx
label_desc: Use image node_id 1 for calling the _TextualSerializer obj's underlying member method code with example usage: obj.serialize_proto(proto) and returns: text