aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/benchmark
diff options
context:
space:
mode:
authorGravatar Andrew Harp <andrewharp@google.com>2016-07-22 07:41:10 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-07-22 08:48:34 -0700
commitb25c477f43b2761b7ffb99185bbda8602219c4a6 (patch)
tree6e67c6bd58acff7d39e798c744a197134d7f683b /tensorflow/tools/benchmark
parentd05c1f1bd891ab9030c55705dc0935f23e352fc3 (diff)
Rearrange error checking in benchmark_model so that most informative check is done first.
Change: 128177141
Diffstat (limited to 'tensorflow/tools/benchmark')
-rw-r--r--tensorflow/tools/benchmark/benchmark_model.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/tensorflow/tools/benchmark/benchmark_model.cc b/tensorflow/tools/benchmark/benchmark_model.cc
index ccb579fd03..cc590e07d4 100644
--- a/tensorflow/tools/benchmark/benchmark_model.cc
+++ b/tensorflow/tools/benchmark/benchmark_model.cc
@@ -118,15 +118,16 @@ Status RunBenchmark(DataType input_data_type, TensorShape input_shape,
s = session->Run(run_options, input_tensors, output_names, {},
&output_tensors, &run_metadata);
+ if (!s.ok()) {
+ LOG(ERROR) << "Error during inference: " << s;
+ }
+
assert(run_metadata.has_step_stats());
const StepStats& step_stats = run_metadata.step_stats();
stats->ProcessStepStats(step_stats);
- if (!s.ok()) {
- LOG(ERROR) << "Error during inference: " << s;
- }
return s;
}