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

_get_all_schemas_with_history

_get_doc_template

_insert_diff

Splits a using split, insert HTML differences between pieces. The function relies on package pyquickhelper. …

_populate__get_all_schemas_with_history

change_style

Switches from AaBb into aa_bb.

get_domain_list

Returns the list of available domains.

get_onnx_example

Retrieves examples associated to one operator stored in onnx packages.

get_operator_schemas

Returns all schemas mapped to an operator name.

get_rst_doc

Returns a documentation in RST format for all OnnxOperator.

is_last_schema

Tells if this is the most recent schema for this operator.

onnx_documentation_folder

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.

source on GitHub

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.

source on GitHub

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

source on GitHub

mlprodict.npy.xop_auto.get_domain_list()#

Returns the list of available domains.

source on GitHub

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

source on GitHub

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

source on GitHub

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.

source on GitHub

mlprodict.npy.xop_auto.is_last_schema(sch)#

Tells if this is the most recent schema for this operator.

Parameters:

sch – schema

Returns:

True

source on GitHub

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

source on GitHub