View source on GitHub |
A representation of a pb.Computation
in the tff.Computation
interface.
Inherits From: Computation
, TypedObject
tff.framework.ConcreteComputation(
*,
computation_proto: pb.Computation,
context_stack: tff.framework.ContextStack
,
annotated_type: Optional[tff.types.FunctionType
] = None
)
This implementation exposes methods to retrieve the backing pb.Computation
,
as well as the Python representation of this protocol buffer represented by
an instance of building_blocks.ComputationBuildingBlock
.
Raises | |
---|---|
TypeError
|
If annotated_type is not None and is not compatible with
computation_proto.type .
|
ValueError
|
If computation_proto.type is None .
|
Attributes | |
---|---|
type_signature
|
Returns the TFF type of this object. |
Methods
from_building_block
@classmethod
from_building_block( building_block:
tff.framework.ComputationBuildingBlock
) -> 'ConcreteComputation'
Converts a computation building block to a computation impl.
get_proto
@classmethod
get_proto( value: 'ConcreteComputation' ) -> pb.Computation
to_building_block
to_building_block()
to_compiled_building_block
to_compiled_building_block()
with_type
@classmethod
with_type( value: 'ConcreteComputation', type_spec:
tff.types.FunctionType
) -> 'ConcreteComputation'
__call__
__call__(
*args, **kwargs
)
Invokes the computation with the given arguments in the given context.
Args | |
---|---|
*args
|
The positional arguments. |
**kwargs
|
The keyword-based arguments. |
Returns | |
---|---|
The result of invoking the computation, the exact form of which depends on the context. |
__eq__
__eq__(
other: object
) -> bool
Return self==value.