module npy.xop_auto
#
Short summary#
module mlprodict.npy.xop_auto
Automates the generation of operators for the documentation for the Xop API.
Functions#
function |
truncated documentation |
---|---|
Splits a using split, insert HTML differences between pieces. The function relies on package pyquickhelper. … |
|
Switches from AaBb into aa_bb. |
|
Returns the list of available domains. |
|
Retrieves examples associated to one operator stored in onnx packages. |
|
Returns all schemas mapped to an operator name. |
|
Returns a documentation in RST format for all |
|
Tells if this is the most recent schema for this operator. |
|
Creates documentation in a folder for all known ONNX operators or a subset. |
Documentation#
Automates the generation of operators for the documentation for the Xop API.
New in version 0.9.
- mlprodict.npy.xop_auto._get_all_schemas_with_history()#
- mlprodict.npy.xop_auto._get_doc_template()#
- mlprodict.npy.xop_auto._insert_diff(docs, split='.. tag-diff-insert.')#
Splits a using split, insert HTML differences between pieces. The function relies on package pyquickhelper.
- mlprodict.npy.xop_auto._populate__get_all_schemas_with_history()#
- mlprodict.npy.xop_auto.change_style(name)#
Switches from AaBb into aa_bb.
- Parameters:
name – name to convert
- Returns:
converted name
Example:
<<<
from mlprodict.npy.xop_auto import change_style print("changeStyle --> {0}".format(change_style('change_style')))
>>>
changeStyle --> change_style
- mlprodict.npy.xop_auto.get_domain_list()#
Returns the list of available domains.
- mlprodict.npy.xop_auto.get_onnx_example(op_name)#
Retrieves examples associated to one operator stored in onnx packages.
- Parameters:
op_name – operator name
fmt – rendering format
- Returns:
dictionary
- mlprodict.npy.xop_auto.get_operator_schemas(op_name, version=None, domain=None)#
Returns all schemas mapped to an operator name.
- Parameters:
op_name – name of the operator
version – version
domain – domain
- Returns:
list of schemas
- mlprodict.npy.xop_auto.get_rst_doc(op_name=None, domain=None, version='last', clean=True, diff=False, example=False)#
Returns a documentation in RST format for all
OnnxOperator
.- Parameters:
op_name – operator name of None for all
domain – domain
version – version, None for all, ‘last’ for the most recent one
clean – clean empty lines
diff – highlights differences between two versions
example – add example to the documentation
- Returns:
string
The function relies on module jinja2 or replaces it with a simple rendering if not present.
- mlprodict.npy.xop_auto.is_last_schema(sch)#
Tells if this is the most recent schema for this operator.
- Parameters:
sch – schema
- Returns:
True
- mlprodict.npy.xop_auto.onnx_documentation_folder(folder, ops=None, title='ONNX operators', fLOG=None)#
Creates documentation in a folder for all known ONNX operators or a subset.
- Parameters:
folder – folder where to write the documentation
ops – None for all operators or a subset of them
title – index title
fLOG – logging function
- Returns:
list of creates files