# tff.program.NativeFederatedContext

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

A [`tff.program.FederatedContext`](https://www.tensorflow.org/federated/api_docs/python/tff/program/FederatedContext) backed by an execution context.

Inherits From: [`FederatedContext`](https://www.tensorflow.org/federated/api_docs/python/tff/program/FederatedContext), [`SyncContext`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/SyncContext)

    tff.program.NativeFederatedContext(
        context: https://www.tensorflow.org/federated/api_docs/python/tff/framework/AsyncExecutionContext
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `context` | An [`tff.framework.AsyncExecutionContext`](https://www.tensorflow.org/federated/api_docs/python/tff/framework/AsyncExecutionContext). |

<br />

## Methods

### `invoke`

[View source](https://github.com/tensorflow/federated/blob/v0.87.0
Version 2.0, January 2004
Licensed under the Apache License, Version 2.0 (the)

    invoke(
        comp: https://www.tensorflow.org/federated/api_docs/python/tff/Computation,
        arg: Optional[federated_context.ComputationArgValue]
    ) -> structure_utils.Structure[NativeValueReference]

Invokes the `comp` with the argument `arg`.

<br />

<br />

<br />

| Args ||
|---|---|
| `comp` | The [`tff.Computation`](https://www.tensorflow.org/federated/api_docs/python/tff/Computation) being invoked. |
| `arg` | The optional argument of `comp`; server-placed values must be represented by [`tff.program.MaterializableStructure`](https://www.tensorflow.org/federated/api_docs/python/tff/program/MaterializableStructure), and client-placed values must be represented by structures of values returned by a [`tff.program.FederatedDataSourceIterator`](https://www.tensorflow.org/federated/api_docs/python/tff/program/FederatedDataSourceIterator). |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| The result of invocation; a structure of [`tff.program.MaterializableValueReference`](https://www.tensorflow.org/federated/api_docs/python/tff/program/MaterializableValueReference). ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If the result type of the invoked computation does not contain only structures, server-placed values, or tensors. |

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If the result type of `comp` does not contain only structures, server-placed values, or tensors. |

<br />