aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/build_defs.bzl
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2016-09-13 11:13:25 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-09-13 12:18:04 -0700
commit73b4cc4dd15f21d13d40cc906cd4f9d4708c71cc (patch)
tree5ca109c2595ca25a94a0737cd70c173f15b7404c /tensorflow/python/build_defs.bzl
parent9e2771c11bb0ea5f42fa9ea92350c5af0fea9ab4 (diff)
Split python:ops into individual op libraries to allow for finer grain dependency analysis. Additionally expanded all cuda_py_tests to singular cuda_py_test for the same reason.
Restrict the visibility of the generated op code and replace them with the unified generated + hand-coded versions. Change: 133030838
Diffstat (limited to 'tensorflow/python/build_defs.bzl')
-rw-r--r--tensorflow/python/build_defs.bzl27
1 files changed, 27 insertions, 0 deletions
diff --git a/tensorflow/python/build_defs.bzl b/tensorflow/python/build_defs.bzl
new file mode 100644
index 0000000000..71adab99e0
--- /dev/null
+++ b/tensorflow/python/build_defs.bzl
@@ -0,0 +1,27 @@
+# -*- Python -*-
+
+load("//tensorflow:tensorflow.bzl", "tf_gen_op_wrapper_py")
+
+# Intended only for use within this directory.
+# Generated python wrappers are private visibility, users should depend on the
+# full python code that incorporates the wrappers. The generated targets have
+# a _gen suffix, so that the full python version can use the bare name.
+# We also hard code the hidden_file here to reduce duplication.
+#
+# We should consider moving the "out" default pattern into here, many other
+# consumers of the tf_gen_op_wrapper_py rule would be simplified if we don't
+# hard code the ops/ directory.
+
+def tf_gen_op_wrapper_private_py(name, out=None, deps=[],
+ require_shape_functions=False):
+ if not name.endswith("_gen"):
+ fail("name must end in _gen")
+ bare_op_name = name[:-4] # Strip of the _gen
+ tf_gen_op_wrapper_py(name=bare_op_name,
+ out=out,
+ hidden_file="ops/hidden_ops.txt",
+ visibility=["//visibility:private"],
+ deps=deps,
+ require_shape_functions=require_shape_functions,
+ generated_target_name=name,
+ )