Skip to content

Commit

Permalink
total
Browse files Browse the repository at this point in the history
  • Loading branch information
PINTO0309 committed May 27, 2022
1 parent 8206a0a commit e4b9746
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,60 @@ structure_check(
## 6. Sample
![yeuq7-3pab9](https://user-images.githubusercontent.com/33194443/170716241-1b0aaf0d-ea36-4508-b8ba-1e076e648a2e.gif)

```bash
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ OP Type ┃ OPs ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Add │ 3907 │
│ AveragePool │ 3 │
│ Cast │ 2652 │
│ Concat │ 1983 │
│ Constant │ 14992 │
│ ConstantOfShape │ 1350 │
│ Conv │ 710 │
│ Div │ 1107 │
│ Einsum │ 353 │
│ Equal │ 1240 │
│ Expand │ 1662 │
│ Floor │ 416 │
│ Gather │ 1411 │
│ GatherElements │ 832 │
│ Greater │ 832 │
│ InstanceNormalization │ 15 │
│ Less │ 832 │
│ MatMul │ 1 │
│ Mul │ 5267 │
│ Neg │ 206 │
│ Not │ 102 │
│ Pad │ 212 │
│ Range │ 206 │
│ ReduceSum │ 14 │
│ Relu │ 352 │
│ Reshape │ 2410 │
│ ScatterND │ 102 │
│ Shape │ 1556 │
│ Sigmoid │ 208 │
│ Slice │ 620 │
│ Softmax │ 1 │
│ Split │ 208 │
│ Sqrt │ 13 │
│ Sub │ 2446 │
│ Tanh │ 104 │
│ Tile │ 2 │
│ Transpose │ 317 │
│ Unsqueeze │ 3866 │
│ Where │ 2904 │
│ ---------------------- │ ---------- │
│ Total number of OPs │ 55414 │
│ ====================== │ ========== │
│ Model Size │ 37.2MiB │
└────────────────────────┴────────────┘
INFO: file: deqflow_b_things_opset12_192x320.onnx
INFO: input_name.1: input1 shape: [1, 3, 192, 320] dtype: float32
INFO: input_name.2: input2 shape: [1, 3, 192, 320] dtype: float32
INFO: output_name.1: flow_up shape: [1, 2, 192, 320] dtype: float32
```

## 7. Reference
1. https://github.com/onnx/onnx/blob/main/docs/Operators.md
2. https://docs.nvidia.com/deeplearning/tensorrt/onnx-graphsurgeon/docs/index.html
Expand Down
6 changes: 5 additions & 1 deletion ssc4onnx/onnx_structure_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ def structure_check(
table = Table()
table.add_column('OP Type')
table.add_column('OPs')
_ = [table.add_row(key, str(model_info.op_nums[key])) for key in sorted(list(set(model_info.op_nums.keys())))]
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('----------------------', '----------')
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('======================', '==========')
table.add_row('Model Size', human_readable_size(model_info.model_size))
rich_print(table)
print(\
Expand Down

0 comments on commit e4b9746

Please sign in to comment.