From 7cd40e40be15f4a117605c9b5c0f5533df0f524e Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Tue, 14 Jun 2022 11:31:33 +0000 Subject: [PATCH] more docstring --- speechx/examples/ds2_ol/onnx/local/netron.sh | 2 ++ speechx/examples/ds2_ol/onnx/local/onnx_clone.sh | 1 + speechx/examples/ds2_ol/onnx/local/onnx_opt.sh | 2 +- speechx/examples/ds2_ol/onnx/local/onnx_prune_model.py | 4 +++- speechx/examples/ds2_ol/onnx/local/onnx_rename_model.py | 2 ++ speechx/examples/ds2_ol/onnx/local/pd_infer_shape.py | 1 + speechx/examples/ds2_ol/onnx/local/pd_prune_model.py | 1 + 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/speechx/examples/ds2_ol/onnx/local/netron.sh b/speechx/examples/ds2_ol/onnx/local/netron.sh index 73e089ed..6dd9a39c 100755 --- a/speechx/examples/ds2_ol/onnx/local/netron.sh +++ b/speechx/examples/ds2_ol/onnx/local/netron.sh @@ -1,5 +1,7 @@ #!/bin/bash +# show model + if [ $# != 1 ];then echo "usage: $0 model_path" exit 1 diff --git a/speechx/examples/ds2_ol/onnx/local/onnx_clone.sh b/speechx/examples/ds2_ol/onnx/local/onnx_clone.sh index 0a472af4..bce22dbc 100644 --- a/speechx/examples/ds2_ol/onnx/local/onnx_clone.sh +++ b/speechx/examples/ds2_ol/onnx/local/onnx_clone.sh @@ -1,6 +1,7 @@ #!/bin/bash +# clone onnx repos git clone https://github.com/onnx/onnx.git git clone https://github.com/microsoft/onnxruntime.git git clone https://github.com/PaddlePaddle/Paddle2ONNX.git \ No newline at end of file diff --git a/speechx/examples/ds2_ol/onnx/local/onnx_opt.sh b/speechx/examples/ds2_ol/onnx/local/onnx_opt.sh index dd8fbd20..470a9a31 100755 --- a/speechx/examples/ds2_ol/onnx/local/onnx_opt.sh +++ b/speechx/examples/ds2_ol/onnx/local/onnx_opt.sh @@ -1,4 +1,4 @@ #!/bin/bash - +# onnx optimizer onnx-simplifier \ No newline at end of file diff --git a/speechx/examples/ds2_ol/onnx/local/onnx_prune_model.py b/speechx/examples/ds2_ol/onnx/local/onnx_prune_model.py index a5148edd..f709b8f3 100644 --- a/speechx/examples/ds2_ol/onnx/local/onnx_prune_model.py +++ b/speechx/examples/ds2_ol/onnx/local/onnx_prune_model.py @@ -1,11 +1,13 @@ #!/usr/bin/env python3 -W ignore::DeprecationWarning + +# prune model by output names + import argparse import copy import sys import onnx - def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument( diff --git a/speechx/examples/ds2_ol/onnx/local/onnx_rename_model.py b/speechx/examples/ds2_ol/onnx/local/onnx_rename_model.py index f508c0a3..8724c84d 100755 --- a/speechx/examples/ds2_ol/onnx/local/onnx_rename_model.py +++ b/speechx/examples/ds2_ol/onnx/local/onnx_rename_model.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 -W ignore::DeprecationWarning + +# rename node to new names import argparse import sys diff --git a/speechx/examples/ds2_ol/onnx/local/pd_infer_shape.py b/speechx/examples/ds2_ol/onnx/local/pd_infer_shape.py index 318131f9..723137b8 100755 --- a/speechx/examples/ds2_ol/onnx/local/pd_infer_shape.py +++ b/speechx/examples/ds2_ol/onnx/local/pd_infer_shape.py @@ -2,6 +2,7 @@ # https://github.com/jiangjiajun/PaddleUtils/blob/main/paddle/README.md#2-%E4%BF%AE%E6%94%B9paddle%E6%A8%A1%E5%9E%8B%E8%BE%93%E5%85%A5shape import argparse +# paddle inference shape def process_old_ops_desc(program): """set matmul op head_number attr to 1 is not exist. diff --git a/speechx/examples/ds2_ol/onnx/local/pd_prune_model.py b/speechx/examples/ds2_ol/onnx/local/pd_prune_model.py index d723c7ce..78346651 100755 --- a/speechx/examples/ds2_ol/onnx/local/pd_prune_model.py +++ b/speechx/examples/ds2_ol/onnx/local/pd_prune_model.py @@ -4,6 +4,7 @@ import argparse import sys from typing import List +# paddle prune model. def prepend_feed_ops(program, feed_target_names: List[str],