aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/cc/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/cc/BUILD')
-rw-r--r--tensorflow/cc/BUILD77
1 files changed, 69 insertions, 8 deletions
diff --git a/tensorflow/cc/BUILD b/tensorflow/cc/BUILD
index 8f9ac46676..d48494698b 100644
--- a/tensorflow/cc/BUILD
+++ b/tensorflow/cc/BUILD
@@ -21,7 +21,6 @@ cc_library(
deps = [
":cc_ops",
":grad_op_registry",
- ":math_grad",
":ops",
":scope",
"//tensorflow/core:core_cpu",
@@ -36,7 +35,9 @@ tf_cc_test(
deps = [
":cc_ops",
":grad_op_registry",
+ ":grad_ops",
":gradients",
+ ":testutil",
"//tensorflow/core:all_kernels",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
@@ -47,6 +48,26 @@ tf_cc_test(
)
cc_library(
+ name = "grad_ops",
+ deps = [
+ ":array_grad",
+ ":math_grad",
+ ],
+)
+
+cc_library(
+ name = "grad_testutil",
+ testonly = 1,
+ srcs = ["gradients/grad_testutil.cc"],
+ hdrs = ["gradients/grad_testutil.h"],
+ deps = [
+ ":grad_op_registry",
+ ":ops",
+ ":scope",
+ ],
+)
+
+cc_library(
name = "ops",
srcs = ["framework/ops.cc"],
hdrs = ["framework/ops.h"],
@@ -147,6 +168,33 @@ cc_library(
)
cc_library(
+ name = "array_grad",
+ srcs = ["gradients/array_grad.cc"],
+ deps = [
+ ":cc_ops",
+ ":grad_op_registry",
+ ":ops",
+ ":scope",
+ "//tensorflow/core:core_cpu",
+ "//tensorflow/core:framework",
+ ],
+)
+
+tf_cc_test(
+ name = "gradients/array_grad_test",
+ deps = [
+ ":array_grad",
+ ":cc_ops",
+ ":grad_op_registry",
+ ":grad_testutil",
+ ":testutil",
+ "//tensorflow/core:test",
+ "//tensorflow/core:test_main",
+ "//tensorflow/core:testlib",
+ ],
+)
+
+cc_library(
name = "math_grad",
srcs = ["gradients/math_grad.cc"],
deps = [
@@ -164,12 +212,10 @@ tf_cc_test(
deps = [
":cc_ops",
":grad_op_registry",
+ ":grad_testutil",
":math_grad",
- "//tensorflow/core:all_kernels",
- "//tensorflow/core:core_cpu",
- "//tensorflow/core:framework",
+ ":testutil",
"//tensorflow/core:lib_internal",
- "//tensorflow/core:tensorflow",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
@@ -212,9 +258,7 @@ tf_cc_test(
":client_session",
":test_op",
":test_op_op_lib",
- "//tensorflow/core:all_kernels",
- "//tensorflow/core:core_cpu",
- "//tensorflow/core:tensorflow",
+ ":testutil",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
@@ -254,6 +298,23 @@ cc_library(
alwayslink = 1,
)
+cc_library(
+ name = "testutil",
+ testonly = 1,
+ srcs = ["framework/testutil.cc"],
+ hdrs = ["framework/testutil.h"],
+ deps = [
+ ":client_session",
+ ":ops",
+ ":scope",
+ "//tensorflow/core:all_kernels",
+ "//tensorflow/core:core_cpu",
+ "//tensorflow/core:lib_internal",
+ "//tensorflow/core:tensorflow",
+ "//tensorflow/core:testlib",
+ ],
+)
+
tf_gen_op_wrappers_cc(
name = "test_op",
op_lib_names = [