Skip to content

Commit 6c62e6b

Browse files
committed
Address review comments
Signed-off-by: Xiaodong Ye <[email protected]>
1 parent 64f137e commit 6c62e6b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/compare-test-backend-ops-perf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import re
66
import sys
77
from pathlib import Path
8+
from typing import Tuple, Union
89

910
# Set up logging
1011
logger = logging.getLogger(__name__)
1112
logging.basicConfig(level=logging.INFO, format="%(message)s")
1213

1314

14-
def parse_benchmark_line(line: str):
15+
def parse_benchmark_line(line: str) -> Tuple[Union[str, None], Union[float, None]]:
1516
"""
1617
Parses a single line of benchmark output.
1718
@@ -43,8 +44,10 @@ def parse_benchmark_line(line: str):
4344
gflops = value * 1000
4445
elif unit == "MFLOPS":
4546
gflops = value / 1000
46-
else: # GFLOPS
47+
elif unit == "GFLOPS":
4748
gflops = value
49+
else:
50+
assert False
4851

4952
return key, gflops
5053

0 commit comments

Comments
 (0)