diff options
author | Asim Shankar <ashankar@google.com> | 2017-08-28 10:56:02 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-08-28 11:00:01 -0700 |
commit | 73cf0da3c5aab8e98cd66e91e5714df8196e5755 (patch) | |
tree | bf512fd2beefe6866888b9aca849da471cc45b6f /tensorflow/contrib/android | |
parent | 11698cc8e157eefe71a60931f1e721ad327e08af (diff) |
TensorFlowInferenceInterface: Update some old comments.
PiperOrigin-RevId: 166726527
Diffstat (limited to 'tensorflow/contrib/android')
-rw-r--r-- | tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java b/tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java index 9b7f394258..a75ec45e0b 100644 --- a/tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java +++ b/tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java @@ -16,8 +16,8 @@ limitations under the License. package org.tensorflow.contrib.android; import android.content.res.AssetManager; -import android.os.Trace; import android.os.Build.VERSION; +import android.os.Trace; import android.text.TextUtils; import android.util.Log; import java.io.FileInputStream; @@ -86,7 +86,7 @@ public class TensorFlowInferenceInterface { throw new RuntimeException("Failed to load model from '" + model + "'", e); } } - + /* * Load a TensorFlow model from provided InputStream. * Note: The InputStream will not be closed after loading model, users need to @@ -96,7 +96,7 @@ public class TensorFlowInferenceInterface { */ public TensorFlowInferenceInterface(InputStream is) { prepareNativeRuntime(); - + // modelName is redundant for model loading from input stream, here is for // avoiding error in initialization as modelName is marked final. this.modelName = ""; @@ -191,8 +191,9 @@ public class TensorFlowInferenceInterface { } /** - * Cleans up the state associated with this Object. initializeTensorFlow() can then be called - * again to initialize a new session. + * Cleans up the state associated with this Object. + * + * <p>The TenosrFlowInferenceInterface object is no longer usable after this method returns. */ public void close() { closeFeeds(); @@ -417,7 +418,7 @@ public class TensorFlowInferenceInterface { public void fetch(String outputName, ByteBuffer dst) { getTensor(outputName).writeTo(dst); } - + private void prepareNativeRuntime() { Log.i(TAG, "Checking to see if TensorFlow native methods are already loaded"); try { @@ -442,7 +443,7 @@ public class TensorFlowInferenceInterface { final long startMs = System.currentTimeMillis(); if (VERSION.SDK_INT >= 18) { - Trace.beginSection("initializeTensorFlow"); + Trace.beginSection("loadGraph"); Trace.beginSection("readGraphDef"); } @@ -470,7 +471,7 @@ public class TensorFlowInferenceInterface { if (VERSION.SDK_INT >= 18) { Trace.endSection(); // importGraphDef. - Trace.endSection(); // initializeTensorFlow. + Trace.endSection(); // loadGraph. } final long endMs = System.currentTimeMillis(); @@ -541,7 +542,7 @@ public class TensorFlowInferenceInterface { fetchNames.clear(); } - // State immutable between initializeTensorFlow calls. + // Immutable state. private final String modelName; private final Graph g; private final Session sess; |