1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
# `Predictor` classes provide an interface for efficient, repeated inference.
package(default_visibility = ["//tensorflow/contrib/predictor:__subpackages__"])
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
load("//tensorflow:tensorflow.bzl", "py_test")
py_library(
name = "predictor",
srcs = ["__init__.py"],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
deps = [
":predictor_factories",
"//tensorflow/python:util",
],
)
py_library(
name = "predictor_factories",
srcs = ["predictor_factories.py"],
srcs_version = "PY2AND3",
deps = [
":contrib_estimator_predictor",
":core_estimator_predictor",
":saved_model_predictor",
"//tensorflow/python/estimator:estimator_py",
],
)
py_library(
name = "base_predictor",
srcs = ["predictor.py"],
srcs_version = "PY2AND3",
deps = ["@six_archive//:six"],
)
py_library(
name = "saved_model_predictor",
srcs = ["saved_model_predictor.py"],
srcs_version = "PY2AND3",
deps = [
":base_predictor",
"//tensorflow/contrib/saved_model:saved_model_py",
"//tensorflow/python:framework_ops",
"//tensorflow/python:session",
"//tensorflow/python/saved_model:loader",
"//tensorflow/python/saved_model:signature_constants",
],
)
py_library(
name = "core_estimator_predictor",
srcs = ["core_estimator_predictor.py"],
srcs_version = "PY2AND3",
deps = [
":base_predictor",
"//tensorflow/python:framework_ops",
"//tensorflow/python:training",
"//tensorflow/python/estimator:estimator_py",
"//tensorflow/python/saved_model:signature_constants",
],
)
py_library(
name = "contrib_estimator_predictor",
srcs = ["contrib_estimator_predictor.py"],
srcs_version = "PY2AND3",
deps = [
":base_predictor",
"//tensorflow/contrib/learn",
"//tensorflow/python:framework_ops",
"//tensorflow/python:training",
],
)
py_library(
name = "testing_common",
srcs = ["testing_common.py"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
deps = [
"//tensorflow/contrib/learn",
"//tensorflow/python:array_ops",
"//tensorflow/python:constant_op",
"//tensorflow/python:control_flow_ops",
"//tensorflow/python:framework_ops",
"//tensorflow/python:math_ops",
"//tensorflow/python/estimator:estimator_py",
"//tensorflow/python/saved_model:signature_constants",
],
)
# Transitive dependencies of this target will be included in the pip package.
py_library(
name = "predictor_pip",
visibility = ["//visibility:public"],
deps = [
":contrib_estimator_predictor",
":core_estimator_predictor",
":saved_model_predictor",
],
)
py_test(
name = "saved_model_predictor_test",
srcs = ["saved_model_predictor_test.py"],
data = [":test_export_dir"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
deps = [
":saved_model_predictor",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_ops",
"//tensorflow/python/saved_model:signature_def_utils",
"//third_party/py/numpy",
],
)
py_test(
name = "predictor_factories_test",
srcs = ["predictor_factories_test.py"],
data = [":test_export_dir"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
deps = [
":predictor_factories",
":testing_common",
],
)
py_test(
name = "core_estimator_predictor_test",
srcs = ["core_estimator_predictor_test.py"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
deps = [
":core_estimator_predictor",
":testing_common",
"//tensorflow/python:client_testlib",
"//third_party/py/numpy",
],
)
py_test(
name = "contrib_estimator_predictor_test",
srcs = ["contrib_estimator_predictor_test.py"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
deps = [
":contrib_estimator_predictor",
":testing_common",
"//tensorflow/python:client_testlib",
"//third_party/py/numpy",
],
)
filegroup(
name = "test_export_dir",
srcs = glob(["test_export_dir/**/*"]),
tags = ["no_pip"],
)
|