Skip to content

Commit

Permalink
Merge pull request #3 from PINTO0309/feat/comma
Browse files Browse the repository at this point in the history
thousands separator
  • Loading branch information
PINTO0309 authored Sep 20, 2023
2 parents e6955a2 + 6754999 commit 37cf3d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ssc4onnx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from ssc4onnx.onnx_structure_check import structure_check, main

__version__ = '1.0.5'
__version__ = '1.0.6'
6 changes: 3 additions & 3 deletions ssc4onnx/onnx_structure_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def human_readable_size(num, suffix="B"):
if abs(num) < 1024.0:
return f"{num:3.1f}{unit}{suffix}"
num /= 1024.0
return f"{num:.1f}Yi{suffix}"
return f"{num:,.1f}Yi{suffix}"


class ModelInfo:
Expand Down Expand Up @@ -147,10 +147,10 @@ def structure_check(
table.add_column('OP Type')
table.add_column('OPs')
sorted_list = sorted(list(set(model_info.op_nums.keys())))
_ = [table.add_row(key, str(model_info.op_nums[key])) for key in sorted_list]
_ = [table.add_row(key, f"{model_info.op_nums[key]:,}") for key in sorted_list]
table.add_row('----------------------', '----------')
ops_count = sum([model_info.op_nums[key] for key in sorted_list])
table.add_row('Total number of OPs', str(ops_count))
table.add_row('Total number of OPs', f"{ops_count:,}")
table.add_row('======================', '==========')
table.add_row('Model Size', human_readable_size(model_info.model_size))
rich_print(table)
Expand Down

0 comments on commit 37cf3d1

Please sign in to comment.