diff options
author | Asim Shankar <ashankar@google.com> | 2017-10-04 13:33:07 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-10-04 13:41:31 -0700 |
commit | 083bd5dde5e6845a6f5e3b83ea2e074d7b28d61f (patch) | |
tree | aeb9d0a9ff17d9a4d014816eb5726ebc17ea1caf /tensorflow/java/BUILD | |
parent | 2fe6cf285d2bf4222ea09f9e929e538b64bc376b (diff) |
Java: Add support for loading op libraries dynamically.
This change adds the equivalent of tf.load_op_library in Python to Java.
(https://github.com/tensorflow/tensorflow/commit/5c7f9e316d8c7735308a217310350d416d7498cc
was required to make this possible)
Though, TensorFlow.loadLibrary() is likely to fail on Windows as symbols
required by custom op libraries (those exported by the tensorflow_framework library)
are not exported by the monolithic JNI library yet.
This should help with #10454 and #13476
PiperOrigin-RevId: 171054707
Diffstat (limited to 'tensorflow/java/BUILD')
-rw-r--r-- | tensorflow/java/BUILD | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tensorflow/java/BUILD b/tensorflow/java/BUILD index 9de79af7d2..a380bc2c71 100644 --- a/tensorflow/java/BUILD +++ b/tensorflow/java/BUILD @@ -10,8 +10,9 @@ load(":src/gen/gen_ops.bzl", "tf_java_op_gen_srcjar") load( "//tensorflow:tensorflow.bzl", "tf_binary_additional_srcs", - "tf_copts", "tf_cc_binary", + "tf_copts", + "tf_custom_op_library", "tf_java_test", ) @@ -180,10 +181,16 @@ tf_java_test( ], ) +tf_custom_op_library( + name = "my_test_op.so", + srcs = ["src/test/native/my_test_op.cc"], +) + tf_java_test( name = "TensorFlowTest", size = "small", srcs = ["src/test/java/org/tensorflow/TensorFlowTest.java"], + data = [":my_test_op.so"], javacopts = JAVACOPTS, test_class = "org.tensorflow.TensorFlowTest", deps = [ |