diff options
author | Shashi Shekhar <shashishekhar@google.com> | 2018-07-10 11:31:06 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-07-10 11:34:46 -0700 |
commit | 328db40921708a16d8ddc7c54c6f7929955fc62b (patch) | |
tree | e045692137fa8015680a9fc0e52c2da1c8742482 /tensorflow | |
parent | 01b95ad47c4110ea75f5f5d9e58eb58973471206 (diff) |
Internal change.
PiperOrigin-RevId: 203982502
Diffstat (limited to 'tensorflow')
-rw-r--r-- | tensorflow/contrib/lite/tools/benchmark/benchmark_model.cc | 3 | ||||
-rw-r--r-- | tensorflow/contrib/lite/tools/benchmark/benchmark_model.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/tools/benchmark/benchmark_model.cc b/tensorflow/contrib/lite/tools/benchmark/benchmark_model.cc index 08648bcfe2..19b9a9c7ba 100644 --- a/tensorflow/contrib/lite/tools/benchmark/benchmark_model.cc +++ b/tensorflow/contrib/lite/tools/benchmark/benchmark_model.cc @@ -98,10 +98,13 @@ void BenchmarkModel::LogFlags() { << "]"; } +void BenchmarkModel::PrepareInputsAndOutputs() {} + Stat<int64_t> BenchmarkModel::Run(int num_times, RunType run_type) { Stat<int64_t> run_stats; TFLITE_LOG(INFO) << "Running benchmark for " << num_times << " iterations "; for (int run = 0; run < num_times; run++) { + PrepareInputsAndOutputs(); listeners_.OnSingleRunStart(run_type); int64_t start_us = profiling::time::NowMicros(); RunImpl(); diff --git a/tensorflow/contrib/lite/tools/benchmark/benchmark_model.h b/tensorflow/contrib/lite/tools/benchmark/benchmark_model.h index 942e21f67a..3c7063b2d4 100644 --- a/tensorflow/contrib/lite/tools/benchmark/benchmark_model.h +++ b/tensorflow/contrib/lite/tools/benchmark/benchmark_model.h @@ -150,6 +150,7 @@ class BenchmarkModel { virtual std::vector<Flag> GetFlags(); virtual uint64_t ComputeInputBytes() = 0; virtual tensorflow::Stat<int64_t> Run(int num_times, RunType run_type); + virtual void PrepareInputsAndOutputs(); virtual void RunImpl() = 0; BenchmarkParams params_; BenchmarkListeners listeners_; |