__init__.py 5.03 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
14
"""The TensorFlow Federated library."""
15

16
17
import sys

Michael Reneer's avatar
Michael Reneer committed
18
19
from tensorflow_federated.version import __version__  # pylint: disable=g-bad-import-order

20
from tensorflow_federated import experimental
21
from tensorflow_federated.python import aggregators
22
from tensorflow_federated.python import analytics
23
24
from tensorflow_federated.python import learning
from tensorflow_federated.python import simulation
25
from tensorflow_federated.python.common_libs import structure
26
from tensorflow_federated.python.common_libs import tracing as profiler
27
28
29
30
from tensorflow_federated.python.core import backends
from tensorflow_federated.python.core import framework
from tensorflow_federated.python.core import templates
from tensorflow_federated.python.core import test
31
from tensorflow_federated.python.core import types
Michael Reneer's avatar
Michael Reneer committed
32
from tensorflow_federated.python.core.api.computation_base import Computation
33
from tensorflow_federated.python.core.api.computations import check_returns_type
Michael Reneer's avatar
Michael Reneer committed
34
35
from tensorflow_federated.python.core.api.computations import federated_computation
from tensorflow_federated.python.core.api.computations import tf_computation
36
from tensorflow_federated.python.core.impl.federated_context.data import data
37
38
39
40
41
42
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_aggregate
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_broadcast
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_collect
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_eval
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_map
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_mean
43
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_secure_modular_sum
44
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_secure_select
45
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_secure_sum
46
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_secure_sum_bitwidth
47
48
49
50
51
52
53
54
55
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_select
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_sum
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_value
from tensorflow_federated.python.core.impl.federated_context.intrinsics import federated_zip
from tensorflow_federated.python.core.impl.federated_context.intrinsics import sequence_map
from tensorflow_federated.python.core.impl.federated_context.intrinsics import sequence_reduce
from tensorflow_federated.python.core.impl.federated_context.intrinsics import sequence_sum
from tensorflow_federated.python.core.impl.federated_context.value_impl import to_value
from tensorflow_federated.python.core.impl.federated_context.value_impl import Value
56
57
58
59
60
61
62
63
64
65
from tensorflow_federated.python.core.impl.types.computation_types import at_clients as type_at_clients
from tensorflow_federated.python.core.impl.types.computation_types import at_server as type_at_server
from tensorflow_federated.python.core.impl.types.computation_types import FederatedType
from tensorflow_federated.python.core.impl.types.computation_types import FunctionType
from tensorflow_federated.python.core.impl.types.computation_types import SequenceType
from tensorflow_federated.python.core.impl.types.computation_types import StructType
from tensorflow_federated.python.core.impl.types.computation_types import StructWithPythonType
from tensorflow_federated.python.core.impl.types.computation_types import TensorType
from tensorflow_federated.python.core.impl.types.computation_types import to_type
from tensorflow_federated.python.core.impl.types.computation_types import Type
66
67
from tensorflow_federated.python.core.impl.types.placements import CLIENTS
from tensorflow_federated.python.core.impl.types.placements import SERVER
68
from tensorflow_federated.python.core.impl.types.type_conversions import structure_from_tensor_type_tree
69
from tensorflow_federated.python.core.impl.types.typed_object import TypedObject
Michael Reneer's avatar
Michael Reneer committed
70

71
72
if sys.version_info[0] < 3 or sys.version_info[1] < 7:
  raise Exception('TFF only supports Python versions 3.7 or later.')
73
74
75
76

# Initialize a default execution context. This is implicitly executed the
# first time a module in the `core` package is imported.
backends.native.set_local_execution_context()