Skip to content

Commit 5a2fc5b

Browse files
committed
fix print error
1 parent 3ea19b7 commit 5a2fc5b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

paddle/fluid/inference/analysis/analyzer_lac_tester.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ void TestLACPrediction(const std::string &model_path,
182182
Timer timer;
183183
if (test_all_data) {
184184
double sum = 0;
185+
LOG(INFO) << "Total number of samples: " << data.datasets.size();
185186
for (int i = 0; i < repeat; i++) {
186187
for (size_t bid = 0; bid < data.batched_datas.size(); ++bid) {
187188
GetOneBatch(&input_slots, &data, batch_size);
@@ -190,7 +191,9 @@ void TestLACPrediction(const std::string &model_path,
190191
sum += timer.toc();
191192
}
192193
}
193-
PrintTime(batch_size, repeat, 1, 0, sum / batch_size);
194+
PrintTime(batch_size, repeat, 1, 0, sum / repeat);
195+
LOG(INFO) << "Average latency of each sample: "
196+
<< sum / repeat / data.datasets.size() << " ms";
194197
return;
195198
}
196199
timer.tic();

0 commit comments

Comments
 (0)