diff options
author | Asim Shankar <ashankar@google.com> | 2016-12-06 14:09:03 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-12-06 16:06:23 -0800 |
commit | a3c4e7931c6e6dc76060d5d4f9e0918c55e65ab1 (patch) | |
tree | 82be285662e356c0feee497fe6a7a240fe1e4476 /tensorflow/java/BUILD | |
parent | 48563a91f06dd6fae6354afd4c0a09360f97684c (diff) |
Java: Introduce a graph construction API.
And use it in the Graph unittests.
Subtle point: DT_STRING does not correspond to java.lang.String, but rather byte[]
Change: 141223979
Diffstat (limited to 'tensorflow/java/BUILD')
-rw-r--r-- | tensorflow/java/BUILD | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/tensorflow/java/BUILD b/tensorflow/java/BUILD index c9e6248bf8..4522c4a59e 100644 --- a/tensorflow/java/BUILD +++ b/tensorflow/java/BUILD @@ -12,43 +12,45 @@ java_library( visibility = ["//visibility:public"], ) +java_library( + name = "testutil", + testonly = 1, + srcs = ["src/test/java/org/tensorflow/TestUtil.java"], + deps = [":tensorflow"], +) + java_test( name = "GraphTest", size = "small", srcs = ["src/test/java/org/tensorflow/GraphTest.java"], - data = [":test_graph_def"], test_class = "org.tensorflow.GraphTest", deps = [ ":tensorflow", + ":testutil", "//external:junit", ], ) -# Temporary targets to assist with unittests till the Java API becomes -# expressive enough. Delete this target and corresponding python source code -# when the Java API can construct graphs. -genrule( - name = "test_graph_def", - outs = [":test_graph_def.data"], - cmd = "$(location :graphdef) $@", - tools = [":graphdef"], -) - -py_binary( - name = "graphdef", - srcs = ["src/test/python/graphdef.py"], - srcs_version = "PY2AND3", - deps = ["//tensorflow:tensorflow_py"], +java_test( + name = "OperationBuilderTest", + size = "small", + srcs = ["src/test/java/org/tensorflow/OperationBuilderTest.java"], + test_class = "org.tensorflow.OperationBuilderTest", + deps = [ + ":tensorflow", + ":testutil", + "//external:junit", + ], ) java_test( name = "SessionTest", size = "small", srcs = ["src/test/java/org/tensorflow/SessionTest.java"], - data = [":test_graph_def"], test_class = "org.tensorflow.SessionTest", deps = [ ":tensorflow", + ":testutil", "//external:junit", ], ) |