From 3206bcd9291833518289e73e37513cdbc29e96c7 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Fri, 1 Jun 2018 16:24:55 +0800 Subject: [PATCH] refine log and add QPS --- paddle/fluid/inference/tests/book/test_inference_nlp.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/inference/tests/book/test_inference_nlp.cc b/paddle/fluid/inference/tests/book/test_inference_nlp.cc index 962358d76..378e1620a 100644 --- a/paddle/fluid/inference/tests/book/test_inference_nlp.cc +++ b/paddle/fluid/inference/tests/book/test_inference_nlp.cc @@ -202,11 +202,13 @@ TEST(inference, nlp) { &fetch_targets, !FLAGS_prepare_vars); } stop_ms = GetCurrentMs(); + LOG(INFO) << "Tid: 0, process " << datasets.size() + << " samples, avg time per sample: " + << (stop_ms - start_ms) / datasets.size() << " ms"; } LOG(INFO) << "Total inference time with " << FLAGS_num_threads << " threads : " << (stop_ms - start_ms) / 1000.0 - << " sec, avg time per seq: " - << (stop_ms - start_ms) / datasets.size() << " ms"; + << " sec, QPS: " << datasets.size() / ((stop_ms - start_ms) / 1000); delete scope; } -- GitLab