Merge pull request #43587 from Leslie-Fang:lesliefang/fix_benchmark_small_value

PiperOrigin-RevId: 349277021
Change-Id: I6fdc47bfebdb5b717bebad3588f8dc662b4f2bee
This commit is contained in:
TensorFlower Gardener 2020-12-28 06:42:05 -08:00
commit 65c3386820

View File

@ -204,12 +204,12 @@ void Benchmark::Run(const char* pattern) {
char buf[100];
std::string full_label = label;
if (bytes_processed > 0) {
snprintf(buf, sizeof(buf), " %.1fMB/s",
snprintf(buf, sizeof(buf), " %.5fMB/s",
(bytes_processed * 1e-6) / seconds);
full_label += buf;
}
if (items_processed > 0) {
snprintf(buf, sizeof(buf), " %.1fM items/s",
snprintf(buf, sizeof(buf), " %.5fM items/s",
(items_processed * 1e-6) / seconds);
full_label += buf;
}