|View source on GitHub|
Context objects evaluate invocations of computations.
Invocations of TensorFlow Federated computations need to be treated
differently depending on the
Context in which they are invoked. For example:
- During top-level Python simulations, computation invocations result in the computation being serialized and evaluated by the TensorFlow native runtime.
tf_computation-annotated functions, computation invocations must import the body of the invoked function into the current TensorFlow graph.
Code can customize the way in which each of these calls are evaluated by
setting a specific
Context using a global or thread-local context stack.
invoke( comp, arg )
comp with argument
The computation being invoked. The Python type of
The argument passed to the computation. If no argument is passed,
this will be
|The result of invocation, which is context-dependent.|