Skip to content

Commit 37f224f

Browse files
committed
Update benchmark_utils.py
1 parent 1cf5c7b commit 37f224f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

scripts/benchmarks/benchmark_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,11 @@ def print_results(self, result_dict):
944944
for model_name in self._model_names:
945945
for (batch_size, sequence_length), (time_spent, memory)\
946946
in result_dict[model_name].items():
947-
if time_spent != np.nan:
947+
if np.isnan(time_spent):
948+
time_spent = str(time_spent)
949+
else:
948950
time_spent = round(1000 * time_spent)
949-
time_spent = str(time_spent)
951+
time_spent = str(time_spent)
950952
memory = str(memory)
951953
logger.info(
952954
model_name[:30].center(30) + str(batch_size).center(15) +
@@ -1001,7 +1003,7 @@ def save_to_csv(self, result_dict, filename):
10011003
"model": model_name,
10021004
"batch_size": bs,
10031005
"sequence_length": ss,
1004-
'latency': str(int(latency * 1000)) if latency is not np.nan else str(np.nan),
1006+
'latency': str(int(latency * 1000)) if not np.isnan(latency) else str(np.nan),
10051007
'memory': str(memory),
10061008
}
10071009
)

0 commit comments

Comments
 (0)