module onnxrt.doc.nb_helper

Inheritance diagram of mlprodict.onnxrt.doc.nb_helper

Short summary

module mlprodict.onnxrt.doc.nb_helper

Helpers for notebooks.

source on GitHub

Classes

class

truncated documentation

OnnxNotebook

Defines magic commands to help with notebooks

Functions

function

truncated documentation

onnxview

Displays an ONNX graph into a notebook.

register_onnx_magics

Register magics function, can be called from a notebook.

Properties

property

truncated documentation

Context

return the context or None

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True. At the end of the block, …

Methods

method

truncated documentation

onnxview

Defines %onnxview which displays an ONNX graph.

Documentation

Helpers for notebooks.

source on GitHub

class mlprodict.onnxrt.doc.nb_helper.OnnxNotebook(**kwargs)

Bases: pyquickhelper.ipythonhelper.magic_class.MagicClassWithHelpers

Defines magic commands to help with notebooks

New in version 1.1.

source on GitHub

Create a configurable given a config config.

configConfig

If this is empty, default values are used. If config is a Config instance, it will be used to configure the instance.

parentConfigurable instance, optional

The parent Configurable instance of this object.

Subclasses of Configurable must call the __init__() method of Configurable before doing anything else and using super():

class MyConfigurable(Configurable):
    def __init__(self, config=None):
        super(MyConfigurable, self).__init__(config=config)
        # Then any other code you need to finish initialization.

This ensures that instances will be configured properly.

_trait_default_generators = {}
onnxview(line)

Defines %onnxview which displays an ONNX graph.

onnxview

The magic command %onnxview model_onnx is equivalent to function onnxview:

onnx_view(model_onnx)

It displays a visual representation of an ONNX graph.

source on GitHub

mlprodict.onnxrt.doc.nb_helper.onnxview(graph, recursive=False, local=False, add_rt_shapes=False, runtime='python', size=None, html_size=None)

Displays an ONNX graph into a notebook.

Parameters
  • graph – filename, bytes, or onnx graph.

  • recursive – display subgraph

  • local – use local path to javascript dependencies, recommanded option if used on MyBinder)

  • add_rt_shapes – add information about the shapes the runtime was able to find out, the runtime has to be ‘python’

  • runtime – the view fails if a runtime does not implement a specific node unless runtime is ‘empty’

  • size – graph size

  • html_size – html size

Changed in version 0.6: Parameter runtime was added.

source on GitHub

mlprodict.onnxrt.doc.nb_helper.register_onnx_magics(ip=None)

Register magics function, can be called from a notebook.

Parameters

ip – from get_ipython()

source on GitHub