aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/android
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-06-26 14:00:17 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-26 14:04:35 -0700
commit1fa73c53ab95693f070ce70e6be0c644d83c163a (patch)
treeffbedf825daf1f3453c695a433c8a9cdf93f6019 /tensorflow/contrib/android
parentb13e96e21c1229a905a623111dd89d2bd0cba53b (diff)
Automated g4 rollback of changelist 160182040
PiperOrigin-RevId: 160190881
Diffstat (limited to 'tensorflow/contrib/android')
-rw-r--r--tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java20
1 files changed, 6 insertions, 14 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 b1d18d2faf..1f180429b2 100644
--- a/tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java
+++ b/tensorflow/contrib/android/java/org/tensorflow/contrib/android/TensorFlowInferenceInterface.java
@@ -17,7 +17,6 @@ package org.tensorflow.contrib.android;
import android.content.res.AssetManager;
import android.os.Trace;
-import android.os.Build.VERSION;
import android.text.TextUtils;
import android.util.Log;
import java.io.FileInputStream;
@@ -371,11 +370,9 @@ public class TensorFlowInferenceInterface {
private void loadGraph(InputStream is, Graph g) throws IOException {
final long startMs = System.currentTimeMillis();
- if (VERSION.SDK_INT >= 18) {
- Trace.beginSection("initializeTensorFlow");
- Trace.beginSection("readGraphDef");
- }
+ Trace.beginSection("initializeTensorFlow");
+ Trace.beginSection("readGraphDef");
// TODO(ashankar): Can we somehow mmap the contents instead of copying them?
byte[] graphDef = new byte[is.available()];
final int numBytesRead = is.read(graphDef);
@@ -386,22 +383,17 @@ public class TensorFlowInferenceInterface {
+ " of the graph, expected to read "
+ graphDef.length);
}
+ Trace.endSection();
- if (VERSION.SDK_INT >= 18) {
- Trace.endSection(); // readGraphDef.
- Trace.beginSection("importGraphDef");
- }
-
+ Trace.beginSection("importGraphDef");
try {
g.importGraphDef(graphDef);
} catch (IllegalArgumentException e) {
throw new IOException("Not a valid TensorFlow Graph serialization: " + e.getMessage());
}
+ Trace.endSection();
- if (VERSION.SDK_INT >= 18) {
- Trace.endSection(); // importGraphDef.
- Trace.endSection(); // initializeTensorFlow.
- }
+ Trace.endSection(); // initializeTensorFlow.
final long endMs = System.currentTimeMillis();
Log.i(