module onnxrt.doc.doc_helper#

Inheritance diagram of mlprodict.onnxrt.doc.doc_helper

Short summary#

module mlprodict.onnxrt.doc.doc_helper

Documentation helper.

source on GitHub

Classes#

class

truncated documentation

NewOperatorSchema

Defines a schema for operators added in this package such as TreeEnsembleRegressorDouble.

Functions#

function

truncated documentation

_get_doc_template

change_style

Switches from AaBb into aa_bb.

debug_onnx_object

__dict__ is not in most of onnx objects. This function uses function dir to explore this object.

get_rst_doc

Returns a documentation in RST format for all OnnxOperator.

type_mapping

Mapping between types name and type integer value.

visual_rst_template

Returns a jinja2 template to display DOT graph for each converter from sklearn-onnx.

Methods#

method

truncated documentation

__init__

Documentation#

Documentation helper.

source on GitHub

class mlprodict.onnxrt.doc.doc_helper.NewOperatorSchema(name)#

Bases: object

Defines a schema for operators added in this package such as TreeEnsembleRegressorDouble.

source on GitHub

__init__(name)#
mlprodict.onnxrt.doc.doc_helper._get_doc_template()#
mlprodict.onnxrt.doc.doc_helper.change_style(name)#

Switches from AaBb into aa_bb.

Parameters:

name – name to convert

Returns:

converted name

source on GitHub

mlprodict.onnxrt.doc.doc_helper.debug_onnx_object(obj, depth=3)#

__dict__ is not in most of onnx objects. This function uses function dir to explore this object.

source on GitHub

mlprodict.onnxrt.doc.doc_helper.get_rst_doc(op_name)#

Returns a documentation in RST format for all OnnxOperator.

Parameters:

op_name – operator name of None for all

Returns:

string

The function relies on module jinja2 or replaces it with a simple rendering if not present.

source on GitHub

mlprodict.onnxrt.doc.doc_helper.type_mapping(name)#

Mapping between types name and type integer value.

<<<

from mlprodict.onnxrt.doc.doc_helper import type_mapping
import pprint
pprint.pprint(type_mapping(None))
print(type_mapping("INT"))
print(type_mapping(2))

>>>

    {'FLOAT': 1,
     'FLOATS': 6,
     'GRAPH': 5,
     'GRAPHS': 10,
     'INT': 2,
     'INTS': 7,
     'SPARSE_TENSOR': 11,
     'STRING': 3,
     'STRINGS': 8,
     'TENSOR': 4,
     'TENSORS': 9,
     'UNDEFINED': 0}
    2
    INT

source on GitHub

mlprodict.onnxrt.doc.doc_helper.visual_rst_template()#

Returns a jinja2 template to display DOT graph for each converter from sklearn-onnx.

<<<

from mlprodict.onnxrt.doc.doc_helper import visual_rst_template
print(visual_rst_template())

>>>

    
    
    .. _l-{{link}}:
    
    {{ title }}
    {{ '=' * len(title) }}
    
    Fitted on a problem type *{{ kind }}*
    (see :func:`find_suitable_problem
    <mlprodict.onnxrt.validate.validate_problems.find_suitable_problem>`),
    method `{{ method }}` matches output {{ output_index }}.
    {{ optim_param }}
    
    ::
    
        {{ indent(model, "    ") }}
    
    {{ table }}
    
    .. gdot::
    
        {{ indent(dot, "    ") }}

source on GitHub