From 5a2fc5b52f20b0c905a38ebd0fe206f88dadd649 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Fri, 7 Sep 2018 22:54:42 +0800 Subject: [PATCH] fix print error --- paddle/fluid/inference/analysis/analyzer_lac_tester.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/analysis/analyzer_lac_tester.cc b/paddle/fluid/inference/analysis/analyzer_lac_tester.cc index b906b32cf..522d870db 100644 --- a/paddle/fluid/inference/analysis/analyzer_lac_tester.cc +++ b/paddle/fluid/inference/analysis/analyzer_lac_tester.cc @@ -182,6 +182,7 @@ void TestLACPrediction(const std::string &model_path, Timer timer; if (test_all_data) { double sum = 0; + LOG(INFO) << "Total number of samples: " << data.datasets.size(); for (int i = 0; i < repeat; i++) { for (size_t bid = 0; bid < data.batched_datas.size(); ++bid) { GetOneBatch(&input_slots, &data, batch_size); @@ -190,7 +191,9 @@ void TestLACPrediction(const std::string &model_path, sum += timer.toc(); } } - PrintTime(batch_size, repeat, 1, 0, sum / batch_size); + PrintTime(batch_size, repeat, 1, 0, sum / repeat); + LOG(INFO) << "Average latency of each sample: " + << sum / repeat / data.datasets.size() << " ms"; return; } timer.tic(); -- GitLab