• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1licenses(["notice"])  # Apache 2.0
2
3load("//tensorflow:tensorflow.bzl", "py_test", "tf_cc_binary")
4load("//tensorflow:tensorflow.bzl", "cuda_py_test")
5load(
6    "//tensorflow/tools/test:performance.bzl",
7    "tf_py_logged_benchmark",
8)
9
10cc_library(
11    name = "pywrap_tfe_lib",
12    srcs = [
13        "pywrap_tensor.cc",
14        "pywrap_tfe_src.cc",
15    ],
16    hdrs = [
17        "pywrap_tensor.h",
18        "pywrap_tfe.h",
19    ],
20    visibility = ["//tensorflow:internal"],
21    deps = [
22        "//tensorflow/c:c_api",
23        "//tensorflow/c:c_api_internal",
24        "//tensorflow/c/eager:c_api",
25        "//tensorflow/c/eager:c_api_internal",
26        "//tensorflow/c/eager:tape",
27        "//tensorflow/core:lib",
28        "//tensorflow/python:ndarray_tensor",
29        "//tensorflow/python:ndarray_tensor_bridge",
30        "//tensorflow/python:numpy_lib",
31        "//tensorflow/python:py_seq_tensor",
32        "//tensorflow/python:safe_ptr",
33        "//util/python:python_headers",
34    ],
35)
36
37# Transitive dependencies of this target will be included in the pip package.
38py_library(
39    name = "eager_pip",
40    visibility = ["//tensorflow:internal"],
41    deps = [
42        ":backprop",
43        ":context",
44        ":core",
45        ":custom_gradient",
46        ":execute",
47        ":function",
48        ":graph_callable",
49        ":graph_only_ops",
50        ":tape",
51        ":test",
52        "//tensorflow/python:pywrap_tensorflow",
53    ],
54)
55
56py_library(
57    name = "core",
58    srcs = ["core.py"],
59    srcs_version = "PY2AND3",
60    visibility = ["//tensorflow:internal"],
61    deps = [
62        ":context",
63        "//tensorflow/python:errors",
64        "//tensorflow/python:pywrap_tensorflow",
65    ],
66)
67
68py_library(
69    name = "context",
70    srcs = ["context.py"],
71    srcs_version = "PY2AND3",
72    visibility = ["//tensorflow:internal"],
73    deps = [
74        "//tensorflow/python:device",
75        "//tensorflow/python:errors",
76        "//tensorflow/python:platform",
77        "//tensorflow/python:pywrap_tensorflow",
78        "//tensorflow/python:util",
79    ],
80)
81
82py_library(
83    name = "tape",
84    srcs = ["tape.py"],
85    srcs_version = "PY2AND3",
86    visibility = ["//tensorflow:internal"],
87)
88
89cuda_py_test(
90    name = "tensor_test",
91    srcs = ["tensor_test.py"],
92    additional_deps = [
93        ":context",
94        ":test",
95        "//tensorflow/python:errors",
96        "//tensorflow/python:framework_ops",
97    ],
98)
99
100cuda_py_test(
101    name = "backprop_test",
102    srcs = ["backprop_test.py"],
103    additional_deps = [
104        ":backprop",
105        ":context",
106        ":custom_gradient",
107        ":test",
108        "//tensorflow/python:embedding_ops",
109        "//tensorflow/python:array_ops",
110        "//tensorflow/python:math_ops",
111        "//tensorflow/python:nn_ops",
112        "//tensorflow/python:resource_variable_ops",
113        "//tensorflow/python:random_ops",
114        "//tensorflow/python:nn_grad",
115        "//tensorflow/python:training",
116    ],
117)
118
119cuda_py_test(
120    name = "core_test",
121    srcs = ["core_test.py"],
122    additional_deps = [
123        ":context",
124        ":core",
125        ":execute",
126        ":test",
127        "//third_party/py/numpy",
128        "//tensorflow/python:dtypes",
129        "//tensorflow/python:errors",
130        "//tensorflow/python:framework_ops",
131        "//tensorflow/python:framework_test_lib",
132        "//tensorflow/python:pywrap_tensorflow",
133    ],
134)
135
136cuda_py_test(
137    name = "function_test",
138    srcs = ["function_test.py"],
139    additional_deps = [
140        ":backprop",
141        ":context",
142        ":function",
143        ":tape",
144        ":test",
145        "//tensorflow/python:clip_ops",
146        "//tensorflow/python:math_ops",
147        "//tensorflow/python:resource_variable_ops",
148    ],
149)
150
151py_library(
152    name = "test",
153    srcs = ["test.py"],
154    srcs_version = "PY2AND3",
155    visibility = ["//tensorflow:internal"],
156    deps = [
157        ":core",
158        "//tensorflow/python:client_testlib",
159        "//tensorflow/python:framework_ops",
160    ],
161)
162
163py_library(
164    name = "execute",
165    srcs = ["execute.py"],
166    srcs_version = "PY2AND3",
167    visibility = ["//tensorflow:internal"],
168    deps = [
169        ":context",
170        ":core",
171        "//tensorflow/core:protos_all_py",
172        "//tensorflow/python:dtypes",
173        "//tensorflow/python:lib",
174        "//tensorflow/python:pywrap_tensorflow",
175        "//tensorflow/python:tensor_shape",
176        "//tensorflow/python:util",
177        "@six_archive//:six",
178    ],
179)
180
181py_library(
182    name = "execution_callbacks",
183    srcs = ["execution_callbacks.py"],
184    srcs_version = "PY2AND3",
185    visibility = ["//tensorflow:internal"],
186    deps = [
187        ":context",
188        "//tensorflow/python:pywrap_tensorflow",
189        "//third_party/py/numpy",
190    ],
191)
192
193cc_library(
194    name = "python_eager_op_gen",
195    srcs = ["python_eager_op_gen.cc"],
196    hdrs = ["python_eager_op_gen.h"],
197    visibility = ["//visibility:public"],
198    deps = [
199        "//tensorflow/core:framework",
200        "//tensorflow/core:lib",
201        "//tensorflow/core:lib_internal",
202        "//tensorflow/core:op_gen_lib",
203        "//tensorflow/core:proto_text",
204        "//tensorflow/core:protos_all_cc",
205        "//tensorflow/python:python_op_gen",
206    ],
207)
208
209py_library(
210    name = "custom_gradient",
211    srcs = ["custom_gradient.py"],
212    srcs_version = "PY2AND3",
213    visibility = ["//tensorflow:internal"],
214    deps = [
215        ":context",
216        ":tape",
217        "//tensorflow/python:array_ops",
218        "//tensorflow/python:framework_ops",
219        "//tensorflow/python:resource_variable_ops",
220        "//tensorflow/python:util",
221    ],
222)
223
224py_library(
225    name = "graph_only_ops",
226    srcs = ["graph_only_ops.py"],
227    srcs_version = "PY2AND3",
228    visibility = ["//tensorflow:internal"],
229    deps = [
230        "//tensorflow/core:protos_all_py",
231        "//tensorflow/python:framework_ops",
232        "//tensorflow/python:tensor_shape",
233    ],
234)
235
236cuda_py_test(
237    name = "graph_only_ops_test",
238    srcs = ["graph_only_ops_test.py"],
239    additional_deps = [
240        "graph_only_ops",
241        "//third_party/py/numpy",
242        "//tensorflow/python:client_testlib",
243        "//tensorflow/python:dtypes",
244        "//tensorflow/python:framework_test_lib",
245        "//tensorflow/python:math_ops",
246    ],
247)
248
249py_library(
250    name = "framework_for_generated_wrappers",
251    srcs_version = "PY2AND3",
252    visibility = ["//visibility:public"],
253    deps = [
254        "//tensorflow/python:dtypes",
255        "//tensorflow/python:framework_for_generated_wrappers",
256        "//tensorflow/python:tensor_shape",
257        "//tensorflow/python/eager:execute",
258    ],
259)
260
261py_library(
262    name = "function",
263    srcs = ["function.py"],
264    srcs_version = "PY2AND3",
265    visibility = ["//tensorflow:internal"],
266    deps = [
267        ":graph_only_ops",
268        "//tensorflow/python:dtypes",
269        "//tensorflow/python:errors",
270        "//tensorflow/python:framework_ops",
271        "//tensorflow/python:gradients",
272        "//tensorflow/python:graph_to_function_def",
273        "//tensorflow/python:util",
274        "//tensorflow/python/eager:context",
275        "//tensorflow/python/eager:core",
276        "//tensorflow/python/eager:execute",
277        "//tensorflow/python/eager:tape",
278        "//third_party/py/numpy",
279    ],
280)
281
282py_library(
283    name = "graph_callable",
284    srcs = ["graph_callable.py"],
285    srcs_version = "PY2AND3",
286    visibility = ["//tensorflow:internal"],
287    deps = [
288        "//tensorflow/python:array_ops",
289        "//tensorflow/python:dtypes",
290        "//tensorflow/python:errors",
291        "//tensorflow/python:framework_ops",
292        "//tensorflow/python:resource_variable_ops",
293        "//tensorflow/python:util",
294        "//tensorflow/python:variable_scope",
295        "//tensorflow/python/eager:context",
296        "//tensorflow/python/eager:function",
297        "//tensorflow/python/eager:tape",
298    ],
299)
300
301py_test(
302    name = "graph_callable_test",
303    srcs = ["graph_callable_test.py"],
304    srcs_version = "PY2AND3",
305    deps = [
306        ":backprop",
307        ":graph_callable",
308        "//tensorflow/python:dtypes",
309        "//tensorflow/python:function",
310        "//tensorflow/python:init_ops",
311        "//tensorflow/python:math_ops",
312        "//tensorflow/python:variable_scope",
313        "//tensorflow/python/eager:test",
314    ],
315)
316
317py_library(
318    name = "backprop",
319    srcs = ["backprop.py"],
320    srcs_version = "PY2AND3",
321    visibility = ["//tensorflow:internal"],
322    deps = [
323        ":imperative_grad",
324        "//tensorflow/python:array_ops",
325        "//tensorflow/python:constant_op",
326        "//tensorflow/python:dtypes",
327        "//tensorflow/python:errors",
328        "//tensorflow/python:framework_ops",
329        "//tensorflow/python:math_ops",
330        "//tensorflow/python:pywrap_tensorflow",
331        "//tensorflow/python:tensor_shape",
332        "//tensorflow/python:util",
333        "//tensorflow/python/eager:context",
334        "//tensorflow/python/eager:execute",
335        "//tensorflow/python/eager:tape",
336        "@six_archive//:six",
337    ],
338)
339
340cuda_py_test(
341    name = "benchmarks_test",
342    srcs = ["benchmarks_test.py"],
343    additional_deps = [
344        ":backprop",
345        ":context",
346        ":function",
347        ":test",
348        "//third_party/py/numpy",
349        "//tensorflow/python:math_ops",
350        "//tensorflow/python:pywrap_tensorflow",
351        "//tensorflow/python:random_ops",
352    ],
353)
354
355tf_py_logged_benchmark(
356    name = "benchmarks",
357    target = "//tensorflow/python/eager:benchmarks_test",
358)
359
360py_test(
361    name = "tape_test",
362    srcs = ["tape_test.py"],
363    srcs_version = "PY2AND3",
364    deps = [
365        ":backprop",
366        ":context",
367        ":custom_gradient",
368        ":test",
369        "//tensorflow/python:array_ops",
370        "//tensorflow/python:constant_op",
371        "//tensorflow/python:dtypes",
372        "//tensorflow/python:gradients",
373        "//tensorflow/python:math_ops",
374        "//tensorflow/python:nn_grad",
375        "//tensorflow/python:nn_ops",
376    ],
377)
378
379cuda_py_test(
380    name = "ops_test",
381    srcs = ["ops_test.py"],
382    additional_deps = [
383        ":context",
384        ":execute",
385        ":test",
386        "//third_party/py/numpy",
387        "//tensorflow/python:array_ops",
388        "//tensorflow/python:control_flow_ops",
389        "//tensorflow/python:dtypes",
390        "//tensorflow/python:errors",
391        "//tensorflow/python:framework_ops",
392        "//tensorflow/python:framework_test_lib",
393        "//tensorflow/python:layers",
394        "//tensorflow/python:math_ops",
395        "//tensorflow/python:random_ops",
396        "//tensorflow/python:resource_variable_ops",
397        "//tensorflow/python:sparse_ops",
398        "//tensorflow/python:tensor_shape",
399    ],
400)
401
402py_test(
403    name = "pywrap_tfe_test",
404    srcs = ["pywrap_tfe_test.py"],
405    srcs_version = "PY2AND3",
406    deps = [
407        ":backprop",
408        ":context",
409        ":test",
410        "//tensorflow/python:framework_test_lib",
411        "//tensorflow/python:math_ops",
412        "//tensorflow/python:pywrap_tensorflow",
413        "//tensorflow/python:random_ops",
414        "//third_party/py/numpy",
415    ],
416)
417
418# -----------------------------------------------------------------------------
419# Google-internal targets.
420
421filegroup(
422    name = "all_files",
423    srcs = glob(
424        ["**/*"],
425        exclude = [
426            "**/METADATA",
427            "**/OWNERS",
428        ],
429    ),
430    visibility = ["//tensorflow:__subpackages__"],
431)
432
433py_library(
434    name = "imperative_grad",
435    srcs = ["imperative_grad.py"],
436    srcs_version = "PY2AND3",
437)
438