tff.program.NativeFederatedContext
Stay organized with collections
Save and categorize content based on your preferences.
A tff.program.FederatedContext
backed by an execution context.
Inherits From: FederatedContext
, SyncContext
tff.program.NativeFederatedContext(
context: tff.framework.AsyncExecutionContext
)
Methods
invoke
View source
invoke(
comp: tff.Computation
,
arg: Optional[federated_context.ComputationArgValue]
) -> structure_utils.Structure[NativeValueReference]
Invokes the comp
with the argument arg
.
Raises |
ValueError
|
If the result type of the invoked computation does not contain
only structures, server-placed values, or tensors.
|
Raises |
ValueError
|
If the result type of comp does not contain only structures,
server-placed values, or tensors.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-20 UTC.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.program.NativeFederatedContext\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [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) |\n\nA [`tff.program.FederatedContext`](../../tff/program/FederatedContext) backed by an execution context.\n\nInherits From: [`FederatedContext`](../../tff/program/FederatedContext), [`SyncContext`](../../tff/framework/SyncContext) \n\n tff.program.NativeFederatedContext(\n context: ../../tff/framework/AsyncExecutionContext\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------|----------------------------------------------------------------------------------------|\n| `context` | An [`tff.framework.AsyncExecutionContext`](../../tff/framework/AsyncExecutionContext). |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `invoke`\n\n[View source](https://github.com/tensorflow/federated/blob/v0.87.0\nVersion 2.0, January 2004\nLicensed under the Apache License, Version 2.0 (the) \n\n invoke(\n comp: ../../tff/Computation,\n arg: Optional[federated_context.ComputationArgValue]\n ) -\u003e structure_utils.Structure[NativeValueReference]\n\nInvokes the `comp` with the argument `arg`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `comp` | The [`tff.Computation`](../../tff/Computation) being invoked. |\n| `arg` | The optional argument of `comp`; server-placed values must be represented by [`tff.program.MaterializableStructure`](../../tff/program/MaterializableStructure), and client-placed values must be represented by structures of values returned by a [`tff.program.FederatedDataSourceIterator`](../../tff/program/FederatedDataSourceIterator). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| The result of invocation; a structure of [`tff.program.MaterializableValueReference`](../../tff/program/MaterializableValueReference). ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|--------------|-------------------------------------------------------------------------------------------------------------------|\n| `ValueError` | If the result type of the invoked computation does not contain only structures, server-placed values, or tensors. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|--------------|--------------------------------------------------------------------------------------------------|\n| `ValueError` | If the result type of `comp` does not contain only structures, server-placed values, or tensors. |\n\n\u003cbr /\u003e"]]