class_docstr: Serialize and deserialize protobuf message.
class_docstr_tok: ["Serialize","and","deserialize","protobuf","message","."]
code: def deserialize_proto(
      self, serialized: bytes, proto: _Proto
  ) -> _Proto:
      if not isinstance(serialized, bytes):
          raise TypeError(
              f"Parameter 'serialized' must be bytes, but got type: {type(serialized)}"
          )
      decoded = typing.cast(
          Optional[int], proto.ParseFromString(serialized)
      )
      if decoded is not None and decoded != len(serialized):
          raise google.protobuf.message.DecodeError(
              f"Protobuf decoding consumed too few bytes: {decoded} out of {len(serialized)}"
          )
      return proto
  
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 2 for calling the _ProtobufSerializer obj's underlying member method code with example usage: obj.deserialize_proto(serialized, proto) and returns: proto