module onnxrt.ops_cpu._op#

Inheritance diagram of mlprodict.onnxrt.ops_cpu._op

Short summary#

module mlprodict.onnxrt.ops_cpu._op

Shortcut to ops_cpu.

source on GitHub

Classes#

class

truncated documentation

DefaultNone

Default value for parameters when the parameter is not set but the operator has a default behaviour for it.

OpRun

Ancestor to all operators in this subfolder. The runtime for every node can checked into ONNX unit tests. …

OpRunArg

Ancestor to all unary operators in this subfolder and which produces position of extremas (ArgMax, …). Checks …

OpRunBinary

Ancestor to all binary operators in this subfolder. Checks that inputs type are the same.

OpRunBinaryComparison

Ancestor to all binary operators in this subfolder comparing tensors.

OpRunBinaryNum

Ancestor to all binary operators in this subfolder. Checks that inputs type are the same.

OpRunBinaryNumpy

Implements the inplaces logic. numpy_fct is a binary numpy function which takes two matrices and has a argument …

OpRunClassifierProb

Ancestor to all binary operators in this subfolder. Checks that inputs type are the same.

OpRunCustom

Automates some methods for custom operators defined outside mlprodict.

OpRunReduceNumpy

Implements the reduce logic. It must have a parameter axes.

OpRunUnary

Ancestor to all unary operators in this subfolder. Checks that inputs type are the same.

OpRunUnaryNum

Ancestor to all unary and numerical operators in this subfolder. Checks that inputs type are the same.

RefAttrName

Implements a link between a parameter of a function and an attribute in node.

RuntimeTypeError

Raised when a type of a variable is unexpected.

Functions#

function

truncated documentation

_build_schemas

Properties#

property

truncated documentation

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

nb_classes

Returns the number of expected classes.

Static Methods#

staticmethod

truncated documentation

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

local_inputs

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part …

Methods#

method

truncated documentation

__init__

__init__

__init__

__init__

__init__

__init__

__init__

__init__

__init__

__init__

__init__

__init__

__repr__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

_find_custom_operator_schema

_find_custom_operator_schema

_find_custom_operator_schema

_find_custom_operator_schema

_find_custom_operator_schema

_find_custom_operator_schema

_find_custom_operator_schema

_find_custom_operator_schema

Finds a custom operator defined by this runtime.

_find_custom_operator_schema

_find_custom_operator_schema

_find_custom_operator_schema

_run

Should be overwritten.

_run

Should be overwritten.

_run

Should be overwritten.

_run

Should be overwritten.

_run

Should be overwritten.

_run

_run

Should be overwritten.

_run

Should be overwritten.

_run

Should be overwritten.

_run

Should be overwritten.

_run

Should be overwritten.

_run_no_checks_

_run_no_checks_

Calls method _run.

_run_no_checks_

Calls method _run.

_run_no_checks_

Calls method _run.

_run_no_checks_

Calls method _run.

_run_no_checks_

_run_no_checks_

_run_no_checks_

_to_python_numpy

_to_python_numpy

_to_python_numpy

_to_python_numpy

_to_python_numpy

_to_python_numpy

_to_python_numpy

_to_python_numpy

_to_python_numpy

_to_python_numpy

_to_python_numpy

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

enable_inplace_compute

Tells the node that one input can be overwritten.

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

need_context

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access …

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

run

Calls method _run.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

switch_initializers_dtype

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

to_python

Returns a python code equivalent to this operator.

Documentation#

Shortcut to ops_cpu.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.DefaultNone#

Bases: object

Default value for parameters when the parameter is not set but the operator has a default behaviour for it.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRun(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: object

Ancestor to all operators in this subfolder. The runtime for every node can checked into ONNX unit tests.

Parameters:
  • onnx_nodeonnx node

  • desc – internal representation

  • expected_attributes – expected attributes for this node

  • options – runtime options

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
__str__()#

usual

source on GitHub

_find_custom_operator_schema(op_name)#
_run(*args, **kwargs)#

Should be overwritten.

source on GitHub

_to_python_numpy(inputs, numpy_name)#
property args_default#

Returns the list of arguments as well as the list of parameters with the default values (close to the signature).

source on GitHub

property args_default_modified#

Returns the list of modified parameters.

source on GitHub

property args_mandatory#

Returns the list of optional arguments.

source on GitHub

property args_optional#

Returns the list of optional arguments.

source on GitHub

property atts_value#

Returns all parameters in a dictionary.

enable_inplace_compute(index)#

Tells the node that one input can be overwritten.

Parameters:

index – input index

source on GitHub

static local_inputs(graph)#

Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part of the context existing in the graph calling this one.

source on GitHub

need_context()#

Tells the runtime if this node needs the context (all the results produced so far) as it may silently access one of them (operator Loop). The default answer is False.

source on GitHub

run(*args, **kwargs)#

Calls method _run.

source on GitHub

switch_initializers_dtype(dtype_in=<class 'numpy.float32'>, dtype_out=<class 'numpy.float64'>)#

Switches all initializers to numpy.float64. If model is None, a simple cast is done.

Parameters:
  • dtype_in – previous type

  • dtype_out – next type

Returns:

done operations

source on GitHub

to_python(inputs)#

Returns a python code equivalent to this operator.

Parameters:

inputs – inputs name

Returns:

imports, python code, both as strings

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRunArg(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRunUnary

Ancestor to all unary operators in this subfolder and which produces position of extremas (ArgMax, …). Checks that inputs type are the same. The class must have attributes axis, keepdim.

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
_run_no_checks_(x, attributes=None, verbose=0, fLOG=None)#
run(x, attributes=None, verbose=0, fLOG=None)#

Calls method _run.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRunBinary(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRun

Ancestor to all binary operators in this subfolder. Checks that inputs type are the same.

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
_run_no_checks_(x, y, attributes=None, verbose=0, fLOG=None)#

Calls method _run.

source on GitHub

run(x, y, attributes=None, verbose=0, fLOG=None)#

Calls method _run.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRunBinaryComparison(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRunBinary

Ancestor to all binary operators in this subfolder comparing tensors.

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
class mlprodict.onnxrt.ops_cpu._op.OpRunBinaryNum(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRunBinary

Ancestor to all binary operators in this subfolder. Checks that inputs type are the same.

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
_run_no_checks_(x, y, attributes=None, verbose=0, fLOG=None)#

Calls method _run.

source on GitHub

run(x, y, attributes=None, verbose=0, fLOG=None)#

Calls method _run.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRunBinaryNumpy(numpy_fct, onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRunBinaryNum

Implements the inplaces logic. numpy_fct is a binary numpy function which takes two matrices and has a argument out for inplace operations.

source on GitHub

__init__(numpy_fct, onnx_node, desc=None, expected_attributes=None, **options)#
_run(a, b, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub

to_python(inputs)#

Returns a python code equivalent to this operator.

Parameters:

inputs – inputs name

Returns:

imports, python code, both as strings

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRunClassifierProb(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRunUnary

Ancestor to all binary operators in this subfolder. Checks that inputs type are the same.

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
_run_no_checks_(x, attributes=None, verbose=0, fLOG=None)#
property nb_classes#

Returns the number of expected classes.

source on GitHub

run(x, attributes=None, verbose=0, fLOG=None)#

Calls method _run.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRunCustom(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRun

Automates some methods for custom operators defined outside mlprodict.

source on GitHub

class OpRunCustomSchema(cls)#

Bases: OperatorSchema

Custom schema.

source on GitHub

__init__(cls)#
__init__(onnx_node, desc=None, expected_attributes=None, **options)#
_find_custom_operator_schema(op_name)#

Finds a custom operator defined by this runtime.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRunReduceNumpy(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRunUnaryNum

Implements the reduce logic. It must have a parameter axes.

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
class mlprodict.onnxrt.ops_cpu._op.OpRunUnary(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRun

Ancestor to all unary operators in this subfolder. Checks that inputs type are the same.

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
run(x, attributes=None, verbose=0, fLOG=None)#

Calls method _run.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.OpRunUnaryNum(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRunUnary

Ancestor to all unary and numerical operators in this subfolder. Checks that inputs type are the same.

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
_run_no_checks_(x, attributes=None, verbose=0, fLOG=None)#
run(x, attributes=None, verbose=0, fLOG=None)#

Calls method _run.

source on GitHub

class mlprodict.onnxrt.ops_cpu._op.RefAttrName(name)#

Bases: object

Implements a link between a parameter of a function and an attribute in node.

Parameters:

name – name of the input

source on GitHub

__init__(name)#
__repr__()#

usual

exception mlprodict.onnxrt.ops_cpu._op.RuntimeTypeError#

Bases: RuntimeError

Raised when a type of a variable is unexpected.

source on GitHub

mlprodict.onnxrt.ops_cpu._op._build_schemas()#