aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/java/BUILD
diff options
context:
space:
mode:
authorGravatar Asim Shankar <ashankar@google.com>2016-12-02 11:11:28 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-12-02 11:25:21 -0800
commit2b1cd28297c4ba9305807f5fe9bb15570758a3fc (patch)
treedc3d6e1570fa4cef025ee525ae0d2e3f85fcd813 /tensorflow/java/BUILD
parent9d832795400495d92d725697909ca7f119c3ba6b (diff)
Java: Introduce the Tensor class and conversions between Tensor and Java
objects. See the added javadoc comments and unittests (TensorTest.java) for an explanation of the API. The conversion between Java types and the Tensor class does involve a single copy. For Java object -> TF_Tensor, a single JNI function (setValue) suffices. For TF_Tensor -> Java object, I couldn't work out a scheme that didn't require a separate JNI function for each primitive type and one JNI function for non-scalars. However, since all these JNI methods are private and not part of the exposed Java API, I figured the "cost" asymmetry in the conversion functions was worth the "benefit" of fewer JNI methods. Another step towards #5 Change: 140871139
Diffstat (limited to 'tensorflow/java/BUILD')
-rw-r--r--tensorflow/java/BUILD12
1 files changed, 12 insertions, 0 deletions
diff --git a/tensorflow/java/BUILD b/tensorflow/java/BUILD
index 2aa077c2b7..69766caf3d 100644
--- a/tensorflow/java/BUILD
+++ b/tensorflow/java/BUILD
@@ -14,6 +14,7 @@ java_library(
java_test(
name = "TensorFlowTest",
+ size = "small",
srcs = ["src/test/java/org/tensorflow/TensorFlowTest.java"],
test_class = "org.tensorflow.TensorFlowTest",
deps = [
@@ -22,6 +23,17 @@ java_test(
],
)
+java_test(
+ name = "TensorTest",
+ size = "small",
+ srcs = ["src/test/java/org/tensorflow/TensorTest.java"],
+ test_class = "org.tensorflow.TensorTest",
+ deps = [
+ ":tensorflow",
+ "//external:junit",
+ ],
+)
+
filegroup(
name = "libtensorflow-jni",
srcs = select({