diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-06-26 14:00:17 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-06-26 14:04:35 -0700 |
commit | 1fa73c53ab95693f070ce70e6be0c644d83c163a (patch) | |
tree | ffbedf825daf1f3453c695a433c8a9cdf93f6019 /tensorflow/contrib/android | |
parent | b13e96e21c1229a905a623111dd89d2bd0cba53b (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.java | 20 |
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( |