![]() |
Generic supertype for operation deserializers.
Each operation deserializer describes how to deserialize operation protos to a specific type of Cirq operation.
Methods
can_deserialize_proto
@abc.abstractmethod
can_deserialize_proto( proto ) -> bool
Whether the given operation can be serialized by this serializer.
from_proto
@abc.abstractmethod
from_proto( proto, *, constants: List[
cirq_google.api.v2.program_pb2.Constant
], deserialized_constants: List[Any] ) -> cirq.Operation
Converts a proto-formatted operation into a Cirq operation.
Args | |
---|---|
proto
|
The proto object to be deserialized. |
constants
|
The list of Constant protos referenced by constant
table indices in proto .
|
deserialized_constants
|
The deserialized contents of constants .
|
Returns | |
---|---|
The deserialized operation represented by proto .
|