tff.framework.ConcreteComputation

A representation of a pb.Computation in the tff.Computation interface.

Inherits From: Computation, TypedObject

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.

computation_proto The protocol buffer that represents the computation, an instance of pb.Computation.
context_stack The context stack to use.
annotated_type Optional, type information with additional annotations that replaces the information in computation_proto.type.

TypeError If annotated_type is not None and is not compatible with computation_proto.type.
ValueError If computation_proto.type is None.

type_signature Returns the TFF type of this object.

Methods

from_building_block

View source

Converts a computation building block to a computation impl.

get_proto

View source

to_building_block

View source

to_compiled_building_block

View source

with_type

View source

__call__

View source

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__

View source

Return self==value.