BUILD 5.8 KB
Newer Older
1 2
load("//tensorflow:tensorflow.bzl", "cuda_py_test")

3 4 5 6
package(
    default_visibility = [
        "//tensorflow:internal",
    ],
7
    licenses = ["notice"],  # Apache 2.0
8 9 10 11 12 13 14 15 16
)

py_library(
    name = "parallel_for",
    srcs = [
        "__init__.py",
        "control_flow_ops.py",
        "gradients.py",
        "pfor.py",
17
        "test_util.py",
18 19 20 21 22
    ],
    srcs_version = "PY2AND3",
    deps = [
        ":control_flow_ops",
        ":gradients",
23
        ":test_util",
24
        "//tensorflow/compiler/tf2xla/python:xla",
25 26 27 28 29 30 31 32 33
        "//tensorflow/python:array_ops",
        "//tensorflow/python:check_ops",
        "//tensorflow/python:constant_op",
        "//tensorflow/python:control_flow_ops",
        "//tensorflow/python:data_flow_ops",
        "//tensorflow/python:dtypes",
        "//tensorflow/python:framework_ops",
        "//tensorflow/python:functional_ops",
        "//tensorflow/python:gradients",
G
Gaurav Jain 已提交
34
        "//tensorflow/python:map_fn",
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
        "//tensorflow/python:math_ops",
        "//tensorflow/python:nn_ops",
        "//tensorflow/python:platform",
        "//tensorflow/python:sparse_ops",
        "//tensorflow/python:sparse_tensor",
        "//tensorflow/python:tensor_array_ops",
        "//tensorflow/python:tensor_shape",
        "//tensorflow/python:tensor_util",
        "//tensorflow/python:util",
        "@absl_py//absl/flags",
    ],
)

py_library(
    name = "pfor_lib",
    srcs = ["pfor.py"],
    srcs_version = "PY2AND3",
    deps = [
53
        "//tensorflow/compiler/tf2xla/python:xla",
54 55 56 57 58 59 60
        "//tensorflow/python:array_ops",
        "//tensorflow/python:check_ops",
        "//tensorflow/python:constant_op",
        "//tensorflow/python:control_flow_ops",
        "//tensorflow/python:data_flow_ops",
        "//tensorflow/python:dtypes",
        "//tensorflow/python:framework_ops",
G
Gaurav Jain 已提交
61
        "//tensorflow/python:map_fn",
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
        "//tensorflow/python:math_ops",
        "//tensorflow/python:nn_ops",
        "//tensorflow/python:platform",
        "//tensorflow/python:sparse_ops",
        "//tensorflow/python:sparse_tensor",
        "//tensorflow/python:tensor_array_ops",
        "//tensorflow/python:tensor_shape",
        "//tensorflow/python:tensor_util",
        "@absl_py//absl/flags",
    ],
)

py_library(
    name = "control_flow_ops",
    srcs = ["control_flow_ops.py"],
    srcs_version = "PY2AND3",
    visibility = ["//visibility:public"],
    deps = [
        ":pfor_lib",
        "//tensorflow/python:array_ops",
        "//tensorflow/python:control_flow_ops",
        "//tensorflow/python:dtypes",
        "//tensorflow/python:framework_ops",
85
        "//tensorflow/python:math_ops",
86
        "//tensorflow/python:tensor_array_ops",
87
        "//tensorflow/python:tensor_util",
88
        "//tensorflow/python:util",
89 90
        "//tensorflow/python/eager:context",
        "//tensorflow/python/eager:function",
91 92 93
    ],
)

94 95 96 97 98 99 100 101 102 103 104 105 106
py_library(
    name = "test_util",
    srcs = ["test_util.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":pfor_lib",
        "//tensorflow/python:client_testlib",
        "//tensorflow/python:framework_ops",
        "//tensorflow/python:util",
        "//tensorflow/python:variables",
    ],
)

107 108 109 110 111
cuda_py_test(
    name = "control_flow_ops_test",
    srcs = ["control_flow_ops_test.py"],
    additional_deps = [
        ":control_flow_ops",
112
        ":test_util",
113 114 115 116 117
        "//tensorflow/core:protos_all_py",
        "//tensorflow/python:client_testlib",
        "//tensorflow/python:gradients",
        "//tensorflow/python:logging_ops",
        "//tensorflow/python:parsing_ops",
118
        "//tensorflow/python:random_ops",
119 120 121 122
        "//tensorflow/python:session",
        "//tensorflow/python:tensor_array_grad",
        "//tensorflow/python:util",
    ],
123
    tags = ["no_rocm"],
124 125
)

126 127 128 129 130 131
cuda_py_test(
    name = "xla_control_flow_ops_test",
    srcs = ["xla_control_flow_ops_test.py"],
    additional_deps = [
        ":control_flow_ops",
        ":test_util",
132 133
        "//tensorflow/python:random_ops",
        "//tensorflow/compiler/tf2xla/python:xla",
134 135 136 137
        "//tensorflow/python/compiler/xla:xla",
        "//tensorflow/python:array_ops",
        "//tensorflow/python:math_ops",
    ],
S
Scott Zhu 已提交
138 139
    tags = [
        "no_rocm",
Y
Yanan Cao 已提交
140 141 142
        # XLA is not enabled by default on Mac or Windows.
        "no_mac",
        "no_windows",
S
Scott Zhu 已提交
143
    ],
144 145 146
    xla_enabled = True,
)

147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
cuda_py_test(
    name = "array_test",
    srcs = ["array_test.py"],
    additional_deps = [
        ":control_flow_ops",
        ":test_util",
        "//tensorflow/python:client_testlib",
        "//tensorflow/python:array_ops",
        "//tensorflow/python:random_ops",
        "//tensorflow/python:util",
        "//tensorflow/python/eager:backprop",
    ],
)

cuda_py_test(
    name = "math_test",
    srcs = ["math_test.py"],
    additional_deps = [
        ":control_flow_ops",
        ":test_util",
        "//tensorflow/python:client_testlib",
        "//tensorflow/python:math_ops",
        "//tensorflow/python:random_ops",
        "//tensorflow/python:util",
    ],
172
    shard_count = 5,
D
Deven Desai 已提交
173 174
    tags = [
        "no_rocm",
175
        "no_windows_gpu",
D
Deven Desai 已提交
176 177
        "optonly",  # Too slow in non-opt mode
    ],
178 179
)

180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
py_library(
    name = "gradients",
    srcs = ["gradients.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":control_flow_ops",
        "//tensorflow/python:array_ops",
        "//tensorflow/python:gradients",
        "//tensorflow/python:util",
    ],
)

cuda_py_test(
    name = "gradients_test",
    srcs = ["gradients_test.py"],
    additional_deps = [
        ":control_flow_ops",
        ":gradients",
        "//third_party/py/numpy",
        "//tensorflow/python:layers",
        "//tensorflow/python:client_testlib",
201 202
        "//tensorflow/python:control_flow_ops",
        "//tensorflow/python:functional_ops",
203 204 205
        "//tensorflow/python:random_ops",
        "//tensorflow/python/ops/losses",
    ],
206
    tags = ["optonly"],  # Too slow in non-opt mode
207
)