Sna4onnx

Latest version: v1.0.6

Safety actively analyzes 619456 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.0.6

- Add short form parameter

$ sna4onnx -h

usage:
sna4onnx [-h]
-if INPUT_ONNX_FILE_PATH
-aot ADD_OP_TYPE
-aon ADD_OP_NAME
[-aoiv NAME TYPE VALUE]
[-aoov NAME TYPE VALUE]
[-aoa NAME DTYPE VALUE]
[-csoon SRCOP_NAME SRCOP_OUTPUT_NAME ADDOP_NAME ADDOP_INPUT_NAME]
-cdoin ADDOP_NAME ADDOP_OUTPUT_NAME DESTOP_NAME DESTOP_INPUT_NAME
[-of OUTPUT_ONNX_FILE_PATH]
[-n]

optional arguments:
-h, --help
show this help message and exit

-if INPUT_ONNX_FILE_PATH, --input_onnx_file_path INPUT_ONNX_FILE_PATH
Input onnx file path.

-aot ADD_OP_TYPE, --add_op_type ADD_OP_TYPE
ONNX OP type.
https://github.com/onnx/onnx/blob/main/docs/Operators.md

-aon ADD_OP_NAME, --add_op_name ADD_OP_NAME
Name of OP to be added.
e.g.
--add_op_name AddOP1

-aoiv ADD_OP_INPUT_VARIABLES ADD_OP_INPUT_VARIABLES ADD_OP_INPUT_VARIABLES, --add_op_input_variables ADD_OP_INPUT_VARIABLES ADD_OP_INPUT_VARIABLES ADD_OP_INPUT_VARIABLES
input_variables can be specified multiple times.
--add_op_input_variables variable_name numpy.dtype shape
https://github.com/onnx/onnx/blob/main/docs/Operators.md
e.g.
--add_op_input_variables inpname1 float32 [1,3,5,5]
--add_op_input_variables inpname2 int32 [1]
--add_op_input_variables inpname3 float64 [1,3,224,224]

-aoov ADD_OP_OUTPUT_VARIABLES ADD_OP_OUTPUT_VARIABLES ADD_OP_OUTPUT_VARIABLES, --add_op_output_variables ADD_OP_OUTPUT_VARIABLES ADD_OP_OUTPUT_VARIABLES ADD_OP_OUTPUT_VARIABLES
output_variables can be specified multiple times.
--add_op_output_variables variable_name numpy.dtype shape
https://github.com/onnx/onnx/blob/main/docs/Operators.md
e.g.
--add_op_output_variables outname1 float32 [1,3,5,5]
--add_op_output_variables outname2 int32 [1]
--add_op_output_variables outname3 float64 [1,3,224,224]

-aoa ADD_OP_ATTRIBUTES ADD_OP_ATTRIBUTES ADD_OP_ATTRIBUTES, --add_op_attributes ADD_OP_ATTRIBUTES ADD_OP_ATTRIBUTES ADD_OP_ATTRIBUTES
attributes can be specified multiple times.
--add_op_attributes name dtype value
dtype is one of "float32" or "float64" or "int32" or "int64" or "str".
https://github.com/onnx/onnx/blob/main/docs/Operators.md
e.g.
--add_op_attributes alpha float32 1.0
--add_op_attributes beta float32 1.0
--add_op_attributes transA int64 0
--add_op_attributes transB int64 0

-csoon CONNECTION_SRC_OP_OUTPUT_NAMES CONNECTION_SRC_OP_OUTPUT_NAMES CONNECTION_SRC_OP_OUTPUT_NAMES CONNECTION_SRC_OP_OUTPUT_NAMES, --connection_src_op_output_names CONNECTION_SRC_OP_OUTPUT_NAMES CONNECTION_SRC_OP_OUTPUT_NAMES CONNECTION_SRC_OP_OUTPUT_NAMES CONNECTION_SRC_OP_OUTPUT_NAMES
Specify the name of the output name from which to connect.
e.g.
-Before-
[OpA]oname1 - iname1[OpB]oname1
[OpC]oname1

-After-
[OpA]oname1 - iname1[AddOP1]oname1 - iname1[OpB]oname1
[OpC]oname1 - iname2[AddOP1]

When extrapolating a new OP between OpA and OpB.
--connection_src_op_output_names OpA oname1 AddOP1 iname1
--connection_src_op_output_names OpC oname1 AddOP1 iname2
This need not be specified only when the type of the newly added OP is Constant.

-cdoin CONNECTION_DEST_OP_INPUT_NAMES CONNECTION_DEST_OP_INPUT_NAMES CONNECTION_DEST_OP_INPUT_NAMES CONNECTION_DEST_OP_INPUT_NAMES, --connection_dest_op_input_names CONNECTION_DEST_OP_INPUT_NAMES CONNECTION_DEST_OP_INPUT_NAMES CONNECTION_DEST_OP_INPUT_NAMES CONNECTION_DEST_OP_INPUT_NAMES
Specify the name of the input name from which to connect.
e.g.
-Before-
[OpA]oname1 - iname1[OpB]oname1
[OpC]oname1

-After-
[OpA]oname1 - iname1[AddOP1]oname1 - iname1[OpB]oname1
[OpC]oname1 - iname2[AddOP1]

When extrapolating a new OP between OpA and OpB.
--connection_dest_op_input_names AddOP1 oname1 OpB iname1

-of OUTPUT_ONNX_FILE_PATH, --output_onnx_file_path OUTPUT_ONNX_FILE_PATH
Output onnx file path.
If not specified, a file with "_mod" appended to the end of input_onnx_file_path is output.
e.g.
aaa.onnx -> aaa_mod.onnx

-n, --non_verbose
Do not show all information logs. Only error logs are displayed.


**Full Changelog**: https://github.com/PINTO0309/sna4onnx/compare/1.0.5...1.0.6

1.0.5

- connection_src_op_output_names and connection_dest_op_input_names require list of list. 1 fateshelled

1.0.4

- `string` attributes bug fixes

1.0.3

- Security update
- README update

1.0.2

- `eval()` -> `ast.literal_eval()`

1.0.1

- Add unconnected input and output variables to the input/output OP of a graph
![image](https://user-images.githubusercontent.com/33194443/165441058-9ec84dc0-1fa7-402d-86e2-a9611d042110.png)

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.