View source on GitHub |
Generic supertype for operation deserializers.
Each operation deserializer describes how to deserialize operation protos
with a particular serialized_id
to a specific type of Cirq operation.
Methods
from_proto
@abc.abstractmethod
from_proto( proto, *, arg_function_language: str = '', 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. |
arg_function_language
|
The arg_function_language field from
Program.Language .
|
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 .
|