MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Run

Method Run

tensorflow/lite/tools/benchmark/benchmark_performance_options.cc:272–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272void BenchmarkPerformanceOptions::Run(int argc, char** argv) {
273 // We first parse flags for single-option runs to get information like
274 // parameters of the input model etc.
275 if (single_option_run_->ParseFlags(&argc, argv) != kTfLiteOk) return;
276
277 // Now, we parse flags that are specified for this particular binary.
278 if (!ParseFlags(&argc, argv)) return;
279
280 // Now, the remaining are unrecognized flags and we simply print them out.
281 for (int i = 1; i < argc; ++i) {
282 TFLITE_LOG(WARN) << "WARNING: unrecognized commandline flag: " << argv[i];
283 }
284
285 CreatePerformanceOptions();
286
287 if (params_.Get<bool>("random_shuffle_benchmark_runs")) {
288 std::random_shuffle(all_run_params_.begin(), all_run_params_.end());
289 }
290
291 // Now perform all runs, each with different performance-affecting parameters.
292 for (const auto& run_params : all_run_params_) {
293 // Reset all performance-related options before any runs.
294 ResetPerformanceOptions();
295 single_option_run_params_->Set(run_params);
296 util::SleepForSeconds(params_.Get<float>("option_benchmark_run_delay"));
297 single_option_run_->Run();
298 }
299
300 all_run_stats_->OutputStats();
301}
302} // namespace benchmark
303} // namespace tflite

Callers

nothing calls this directly

Calls 8

ParseFlagsFunction · 0.85
random_shuffleFunction · 0.85
SleepForSecondsFunction · 0.85
OutputStatsMethod · 0.80
ParseFlagsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected