module cli.onnx_code
#
Short summary#
module mlprodict.cli.onnx_code
Command line to check einsum scenarios.
Functions#
function |
truncated documentation |
---|---|
Generates the documentation for ONNX operators. |
|
Exports an ONNX graph into a python code creating the same graph. |
|
Plots an ONNX graph on the standard output. |
Documentation#
Command line to check einsum scenarios.
- mlprodict.cli.onnx_code.dynamic_doc(verbose=0, fLOG=<built-in function print>)#
Generates the documentation for ONNX operators.
- Parameters:
verbose – displays the list of operator
fLOG – logging function
- mlprodict.cli.onnx_code.onnx_code(filename, format='onnx', output=None, verbose=0, name=None, opset=None, fLOG=<built-in function print>)#
Exports an ONNX graph into a python code creating the same graph.
- Parameters:
filename – onnx file
format – format to export too (onnx, tf2onnx, numpy)
output – output file to produce or None to print it on stdout
verbose – verbosity level
name – rewrite the graph name
opset – overwrite the opset (may not works depending on the format)
fLOG – logging function
Exports an ONNX graph into a python code creating the same graph.
The command converts an ONNX graph into a python code generating the same graph. The python code may use onnx syntax, numpy syntax or tf2onnx syntax.
Example:
python -m mlprodict onnx_code --filename="something.onnx" --format=onnx
<<<
python -m mlprodict onnx_code --help
>>>
usage: onnx_code [-h] [-f FILENAME] [-fo FORMAT] [-o OUTPUT] [-v VERBOSE] [-n NAME] [-op OPSET] Exports an ONNX graph into a python code creating the same graph. optional arguments: -h, --help show this help message and exit -f FILENAME, --filename FILENAME onnx file (default: None) -fo FORMAT, --format FORMAT format to export too (`onnx`, `tf2onnx`, `numpy`) (default: onnx) -o OUTPUT, --output OUTPUT output file to produce or None to print it on stdout (default: ) -v VERBOSE, --verbose VERBOSE verbosity level (default: 0) -n NAME, --name NAME rewrite the graph name (default: ) -op OPSET, --opset OPSET overwrite the opset (may not works depending on the format) (default: )
- mlprodict.cli.onnx_code.plot_onnx(filename, format='onnx', verbose=0, output=None, fLOG=<built-in function print>)#
Plots an ONNX graph on the standard output.
- Parameters:
filename – onnx file
format – format to export too (simple, tree, dot, io, mat, raw)
output – output file to produce or None to print it on stdout
verbose – verbosity level
fLOG – logging function
Plots an ONNX graph as text
The command shows the ONNX graphs as a text on the standard output.
Example:
python -m mlprodict plot_onnx --filename="something.onnx" --format=simple
<<<
python -m mlprodict plot_onnx --help
>>>
usage: plot_onnx [-h] [-f FILENAME] [-fo FORMAT] [-v VERBOSE] [-o OUTPUT] Plots an ONNX graph on the standard output. optional arguments: -h, --help show this help message and exit -f FILENAME, --filename FILENAME onnx file (default: None) -fo FORMAT, --format FORMAT format to export too (`simple`, `tree`, `dot`, `io`, `mat`, `raw`) (default: onnx) -v VERBOSE, --verbose VERBOSE verbosity level (default: 0) -o OUTPUT, --output OUTPUT output file to produce or None to print it on stdout (default: )