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
|
# Description: Tensorflow Serving session_bundle example.
package(
default_visibility = ["//tensorflow/contrib/session_bundle:__subpackages__"],
)
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
# vardef("PYTHON_BIN_PATH", "/usr/bin/python")
filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"**/METADATA",
"**/OWNERS",
"g3doc/sitemap.md",
],
),
visibility = ["//visibility:public"],
)
py_binary(
name = "export_half_plus_two",
srcs = [
"export_half_plus_two.py",
],
srcs_version = "PY2AND3",
deps = [
"//tensorflow:tensorflow_py",
"//tensorflow/contrib/session_bundle:exporter",
],
)
genrule(
name = "half_plus_two",
outs = [
"half_plus_two/00000123/export.meta",
"half_plus_two/00000123/export-00000-of-00001",
],
cmd =
"rm -rf /tmp/half_plus_two; " +
"$(PYTHON_BIN_PATH) $(locations :export_half_plus_two); " +
"cp -r /tmp/half_plus_two/* $(@D)/half_plus_two",
tools = [
":export_half_plus_two",
],
visibility = ["//visibility:public"],
)
|