|
7 | 7 | from textwrap import dedent |
8 | 8 |
|
9 | 9 |
|
10 | | -def get_main_parser() -> ArgumentParser: |
11 | | - parser = ArgumentParser( |
12 | | - prog="onnx_diagnostic", |
13 | | - description="onnx_diagnostic main command line.\n", |
14 | | - formatter_class=RawTextHelpFormatter, |
15 | | - epilog=textwrap.dedent( |
16 | | - """ |
17 | | - Type 'python -m onnx_diagnostic <cmd> --help' |
18 | | - to get help for a specific command. |
19 | | -
|
20 | | - lighten - makes an onnx model lighter by removing the weights, |
21 | | - unlighten - restores an onnx model produces by the previous experiment |
22 | | - run - runs a model and measure the inference time |
23 | | - print - prints the model on standard output |
24 | | - find - find node consuming or producing a result |
25 | | - config - prints a configuration for a model id |
26 | | - """ |
27 | | - ), |
28 | | - ) |
29 | | - parser.add_argument( |
30 | | - "cmd", |
31 | | - choices=["lighten", "unlighten", "run", "print", "find", "config"], |
32 | | - help="Selects a command.", |
33 | | - ) |
34 | | - return parser |
35 | | - |
36 | | - |
37 | 10 | def get_parser_lighten() -> ArgumentParser: |
38 | 11 | parser = ArgumentParser( |
39 | 12 | prog="lighten", |
@@ -254,6 +227,32 @@ def _cmd_config(argv: List[Any]): |
254 | 227 | print(f"task: {task_from_id(args.mid)}") |
255 | 228 |
|
256 | 229 |
|
| 230 | +def get_main_parser() -> ArgumentParser: |
| 231 | + parser = ArgumentParser( |
| 232 | + prog="onnx_diagnostic", |
| 233 | + description="onnx_diagnostic main command line.\n", |
| 234 | + formatter_class=RawTextHelpFormatter, |
| 235 | + epilog=textwrap.dedent( |
| 236 | + """ |
| 237 | + Type 'python -m onnx_diagnostic <cmd> --help' |
| 238 | + to get help for a specific command. |
| 239 | +
|
| 240 | + lighten - makes an onnx model lighter by removing the weights, |
| 241 | + unlighten - restores an onnx model produces by the previous experiment |
| 242 | + print - prints the model on standard output |
| 243 | + find - find node consuming or producing a result |
| 244 | + config - prints a configuration for a model id |
| 245 | + """ |
| 246 | + ), |
| 247 | + ) |
| 248 | + parser.add_argument( |
| 249 | + "cmd", |
| 250 | + choices=["lighten", "unlighten", "run", "print", "find", "config"], |
| 251 | + help="Selects a command.", |
| 252 | + ) |
| 253 | + return parser |
| 254 | + |
| 255 | + |
257 | 256 | def main(argv: Optional[List[Any]] = None): |
258 | 257 | fcts = dict( |
259 | 258 | lighten=_cmd_lighten, |
|
0 commit comments