Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
tensorflow
GitHub Repository: tensorflow/docs-l10n
Path: blob/master/site/en-snapshot/federated/design/context.md
25118 views

Context

[TOC]

Context

A context_base.SyncContext or context_base.AsyncContext is an environment that can construct, compile, or execute an AST.

This API defines a low-level abstraction that should be used when an Executor is not used for execution; the Reference backend integrate at this level.

ExecutionContext

An execution_context.ExecutionContext is context_base.SyncContext or context_base.AsyncContext that compiles computations using a compilation function and executes computations using an Executor.

This API defines a high-level abstraction that should be used when an Executor is used for execution; the native integrates at this level.

FederatedComputationContext

A federated_computation_context.FederatedComputationContext is a context that constructs federated computations. This context is used trace Python functions decorated with the federated_computation.federated_computation decorator.

TensorFlowComputationContext

A tensorflow_computation_context.TensorFlowComputationContext is a context that constructs TensorFlow computations. This context is used to serialize Python functions decorated with the tensorflow_computation.tf_computation decorator.

ContextStack

A context_stack_base.ContextStack is a data structure for interacting with a stack of Contexts.

You can set the context TFF will use to construct, compile, or execute an AST by:

ContextStackImpl

A context_stack_impl.ContextStackImpl is a context_stack_base.ContextStack that is implemented as a common thread-local stack.