aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/session_bundle/example/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/session_bundle/example/BUILD')
-rw-r--r--tensorflow/contrib/session_bundle/example/BUILD52
1 files changed, 52 insertions, 0 deletions
diff --git a/tensorflow/contrib/session_bundle/example/BUILD b/tensorflow/contrib/session_bundle/example/BUILD
new file mode 100644
index 0000000000..8fa0c0b020
--- /dev/null
+++ b/tensorflow/contrib/session_bundle/example/BUILD
@@ -0,0 +1,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"],
+)