ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

tff.framework.DataExecutor

The data executor is responsible for the data building block.

Inherits From: Executor

target_executor Downstream executor that this executor delegates to.
data_backend The data backend responsible for materializing payloads.

TypeError if arguments are of the wrong types.

Methods

close

View source

Release resources associated with this Executor, if any.

If the executor has one or more target Executors, implementation of this method must close them.

create_call

View source

A coroutine that creates a call to comp with optional argument arg.

Args
comp The computation to invoke. It must have been first embedded in the executor by calling create_value() on it first.
arg An optional argument of the call, or None if no argument was supplied. If it is present, it must have been embedded in the executor by calling create_value() on it first.

Returns
An instance of ExecutorValue that represents the constructed call.

create_selection

View source

A coroutine that creates a selection from source.

Args
source The source to select from. The source must have been embedded in this executor by invoking create_value() on it first.
index An integer index to select.

Returns
An instance of ExecutorValue that represents the constructed selection.

create_struct

View source

A coroutine that creates a tuple of elements.

Args
elements A collection of ExecutorValues to create a tuple from. The collection may be of any kind accepted by structure.from_container, including dictionaries and lists. The ExecutorValues in the container must have been created by calling create_value on this executor.

Returns
An instance of ExecutorValue that represents the constructed tuple.

create_value

View source

Creates a value in this executor.

The following kinds of value are supported as the input:

  • An instance of a TFF computation proto that represents a data building block, to be handled natively by this executor.

  • Anything that is supported by the target executor (as a pass-through).

  • A nested structure of any of the above.

Args
value The input for which to create a value.
type_spec An optional TFF type of value.

Returns
A value embedded in the target executor.