diff options
author | Asim Shankar <ashankar@google.com> | 2017-01-12 06:53:31 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-12 07:07:52 -0800 |
commit | e8f2aad0c0502fde74fc629f5b13f04d5d206700 (patch) | |
tree | af3347e1fec6f8ee9417e24e6d6c462231bdaab7 /tensorflow/java/README.md | |
parent | c4c927cb3048109d3e302e966da3663a92264f8c (diff) |
Java/C API: Make them Android friendly.
Make the C library and JNI shared library targets Android friendly by linking
with the smaller android runtime when building with --config=android
Relatedly, strip all but the JNI symbols from libtensorflow_jni.so
(regardless of build configuration) to trim its size down (by roughly
50%).
Link in the Java libraries in the Android examples. The longer term intention
is to encourage use of the TensorFlow Java API in Android and do away with the
TensorFlowInferenceInterface class (and related JNI code) currently used in
Android. This will provide a single, more thoroughly tested API for use in all
Java settings - Android or not. An update to the Android example to switch
to this will come in a follow up change.
NOTES:
- For expediency of this change, the C API call: TF_LoadSessionFromSavedModel
is not available when building for Android. I will look into fixing that
separately.
- Linking in the JNI library required by the TensorFlow Java API results in
a small increase (0.7%) in binary size of libtensorflow_demo.so
An unrelatedly, rename libtensorflow-jni.so to libtensorflow_jni.so
to be consistent with other shared libraries created in tensorflow.
Change: 144320074
Diffstat (limited to 'tensorflow/java/README.md')
-rw-r--r-- | tensorflow/java/README.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/java/README.md b/tensorflow/java/README.md index 5c5e45d4d8..7edd109cfd 100644 --- a/tensorflow/java/README.md +++ b/tensorflow/java/README.md @@ -37,7 +37,7 @@ Build the Java Archive (JAR) and native library: ```sh bazel build -c opt \ //tensorflow/java:tensorflow \ - //tensorflow/java:libtensorflow-jni + //tensorflow/java:libtensorflow_jni ``` ### Maven @@ -86,8 +86,8 @@ bazel run -c opt //tensorflow/java/src/main/java/org/tensorflow/examples:label_i ./src/main/java/org/tensorflow/examples/LabelImage.java ``` -- Make `libtensorflow.jar` and `libtensorflow-jni.so` - (`libtensorflow-jni.dylib` on OS X) available during execution. For example: +- Make `libtensorflow.jar` and `libtensorflow_jni.so` + (`libtensorflow_jni.dylib` on OS X) available during execution. For example: ```sh java \ |