__init__.py 4.06 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.python import aggregators
21
22
from tensorflow_federated.python import learning
from tensorflow_federated.python import simulation
23
from tensorflow_federated.python.common_libs import tracing as profiler
24
25
26
27
28
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
from tensorflow_federated.python.core import utils
Michael Reneer's avatar
Michael Reneer committed
29
from tensorflow_federated.python.core.api.computation_base import Computation
30
31
from tensorflow_federated.python.core.api.computation_types import at_clients as type_at_clients
from tensorflow_federated.python.core.api.computation_types import at_server as type_at_server
Michael Reneer's avatar
Michael Reneer committed
32
33
34
from tensorflow_federated.python.core.api.computation_types import FederatedType
from tensorflow_federated.python.core.api.computation_types import FunctionType
from tensorflow_federated.python.core.api.computation_types import SequenceType
35
36
from tensorflow_federated.python.core.api.computation_types import StructType
from tensorflow_federated.python.core.api.computation_types import StructWithPythonType
Michael Reneer's avatar
Michael Reneer committed
37
38
39
from tensorflow_federated.python.core.api.computation_types import TensorType
from tensorflow_federated.python.core.api.computation_types import to_type
from tensorflow_federated.python.core.api.computation_types import Type
40
from tensorflow_federated.python.core.api.computations import check_returns_type
Michael Reneer's avatar
Michael Reneer committed
41
42
43
44
45
46
from tensorflow_federated.python.core.api.computations import federated_computation
from tensorflow_federated.python.core.api.computations import tf_computation
from tensorflow_federated.python.core.api.intrinsics import federated_aggregate
from tensorflow_federated.python.core.api.intrinsics import federated_apply
from tensorflow_federated.python.core.api.intrinsics import federated_broadcast
from tensorflow_federated.python.core.api.intrinsics import federated_collect
Taylor Cramer's avatar
Taylor Cramer committed
47
from tensorflow_federated.python.core.api.intrinsics import federated_eval
Michael Reneer's avatar
Michael Reneer committed
48
49
50
from tensorflow_federated.python.core.api.intrinsics import federated_map
from tensorflow_federated.python.core.api.intrinsics import federated_mean
from tensorflow_federated.python.core.api.intrinsics import federated_reduce
51
from tensorflow_federated.python.core.api.intrinsics import federated_secure_sum
Michael Reneer's avatar
Michael Reneer committed
52
53
54
55
56
57
58
59
60
61
62
63
from tensorflow_federated.python.core.api.intrinsics import federated_sum
from tensorflow_federated.python.core.api.intrinsics import federated_value
from tensorflow_federated.python.core.api.intrinsics import federated_zip
from tensorflow_federated.python.core.api.intrinsics import sequence_map
from tensorflow_federated.python.core.api.intrinsics import sequence_reduce
from tensorflow_federated.python.core.api.intrinsics import sequence_sum
from tensorflow_federated.python.core.api.placements import CLIENTS
from tensorflow_federated.python.core.api.placements import SERVER
from tensorflow_federated.python.core.api.typed_object import TypedObject
from tensorflow_federated.python.core.api.value_base import Value
from tensorflow_federated.python.core.api.values import to_value

64
if sys.version_info[0] < 3 or sys.version_info[1] < 6:
65
  raise Exception('TFF only supports Python versions 3.6 or later.')
66
67
68
69

# 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()