View source on GitHub
|
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.abstractmethodcan_deserialize_proto( proto ) -> bool
Whether the given operation can be serialized by this serializer.
from_proto
@abc.abstractmethodfrom_proto( proto, *, constants: list[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.
|
View source on GitHub