module onnxrt.ops_cpu._op
#
Short summary#
module mlprodict.onnxrt.ops_cpu._op
Shortcut to ops_cpu.
Classes#
class |
truncated documentation |
---|---|
Default value for parameters when the parameter is not set but the operator has a default behaviour for it. |
|
Runs a custom function. |
|
Ancestor to all operators in this subfolder. The runtime for every node can checked into ONNX unit tests. … |
|
Ancestor to all unary operators in this subfolder and which produces position of extremas (ArgMax, …). Checks … |
|
Ancestor to all binary operators in this subfolder. Checks that inputs type are the same. |
|
Ancestor to all binary operators in this subfolder comparing tensors. |
|
Ancestor to all binary operators in this subfolder. Checks that inputs type are the same. |
|
Implements the inplaces logic. numpy_fct is a binary numpy function which takes two matrices and has a argument … |
|
Ancestor to all binary operators in this subfolder. Checks that inputs type are the same. |
|
Automates some methods for custom operators defined outside mlprodict. |
|
Implements the reduce logic. It must have a parameter axes. |
|
Ancestor to all unary operators in this subfolder. Checks that inputs type are the same. |
|
Ancestor to all unary and numerical operators in this subfolder. Checks that inputs type are the same. |
|
Implements a link between a parameter of a function and an attribute in node. |
|
Raised when a type of a variable is unexpected. |
Functions#
function |
truncated documentation |
---|---|
Properties#
property |
truncated documentation |
---|---|
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of modified parameters. |
Returns the list of modified parameters. |
|
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of modified parameters. |
|
Returns the list of optional arguments. |
Returns the list of optional arguments. |
|
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
Returns the list of optional arguments. |
|
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns all parameters in a dictionary. |
Returns all parameters in a dictionary. |
|
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
|
Returns all parameters in a dictionary. |
Returns the number of expected classes. |
Static Methods#
staticmethod |
truncated documentation |
---|---|
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
|
Returns all varibles not registered as inputs and not produced by an node inside the graph. This inputs are part … |
Methods#
method |
truncated documentation |
---|---|
usual |
|
|
usual |
usual |
|
|
usual |
|
usual |
|
usual |
|
usual |
|
usual |
|
usual |
|
usual |
|
usual |
|
usual |
|
usual |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Finds a custom operator defined by this runtime. |
|
|
|
|
|
|
|
Should be overwritten. |
|
|
Should be overwritten. |
|
Should be overwritten. |
|
Should be overwritten. |
|
Should be overwritten. |
|
Should be overwritten. |
|
Should be overwritten. |
|
Should be overwritten. |
|
Should be overwritten. |
|
Should be overwritten. |
Calls method |
|
|
Calls method |
Calls method |
|
|
Calls method |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tells the node that one input can be overwritten. |
Tells the node that one input can be overwritten. |
|
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the node that one input can be overwritten. |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Tells the runtime if this node needs the context (all the results produced so far) as it may silently access … |
|
Calls method |
Calls method |
|
Calls method |
|
Calls method |
|
|
Calls method |
Calls method |
|
|
Calls method |
Calls method |
|
|
Calls method |
|
Calls method |
Calls method |
|
Calls method |
|
|
Switches all initializers to |
Switches all initializers to |
|
|
Switches all initializers to |
|
Switches all initializers to |
|
Switches all initializers to |
|
Switches all initializers to |
|
Switches all initializers to |
|
Switches all initializers to |
|
Switches all initializers to |
|
Switches all initializers to |
|
Switches all initializers to |
|
Switches all initializers to |
Returns a python code equivalent to this operator. |
|
Returns a python code equivalent to this operator. |
|
|
Returns a python code equivalent to this operator. |
|
Returns a python code equivalent to this operator. |
|
Returns a python code equivalent to this operator. |
|
Returns a python code equivalent to this operator. |
Returns a python code equivalent to this operator. |
|
|
Returns a python code equivalent to this operator. |
|
Returns a python code equivalent to this operator. |
|
Returns a python code equivalent to this operator. |
|
Returns a python code equivalent to this operator. |
|
Returns a python code equivalent to this operator. |
Documentation#
Shortcut to ops_cpu.
- 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.
- class mlprodict.onnxrt.ops_cpu._op.OpFunction(onnx_node, impl)#
Bases:
OpRun
Runs a custom function.
- __init__(onnx_node, impl)#
- _run(*inputs, **kwargs)#
Should be overwritten.
- to_python(inputs)#
Returns a python code equivalent to this operator.
- Parameters:
inputs – inputs name
- Returns:
imports, python code, both as strings
- 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_node – onnx node
desc – internal representation
expected_attributes – expected attributes for this node
options – runtime options
- __init__(onnx_node, desc=None, expected_attributes=None, **options)#
- __str__()#
usual
- _find_custom_operator_schema(op_name)#
- _run(*args, **kwargs)#
Should be overwritten.
- _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).
- property args_default_modified#
Returns the list of modified parameters.
- property args_mandatory#
Returns the list of optional arguments.
- property args_optional#
Returns the list of optional arguments.
- 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
- 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.
- 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.
- run(*args, **kwargs)#
Calls method
_run
.
- 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
- to_python(inputs)#
Returns a python code equivalent to this operator.
- Parameters:
inputs – inputs name
- Returns:
imports, python code, both as strings
- 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.
- __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
.
- 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.
- __init__(onnx_node, desc=None, expected_attributes=None, **options)#
- _run_no_checks_(x, y, attributes=None, verbose=0, fLOG=None)#
Calls method
_run
.
- run(x, y, attributes=None, verbose=0, fLOG=None)#
Calls method
_run
.
- 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.
- __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.
- __init__(onnx_node, desc=None, expected_attributes=None, **options)#
- _run_no_checks_(x, y, attributes=None, verbose=0, fLOG=None)#
Calls method
_run
.
- run(x, y, attributes=None, verbose=0, fLOG=None)#
Calls method
_run
.
- 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.
- __init__(numpy_fct, onnx_node, desc=None, expected_attributes=None, **options)#
- _run(a, b, attributes=None, verbose=0, fLOG=None)#
Should be overwritten.
- to_python(inputs)#
Returns a python code equivalent to this operator.
- Parameters:
inputs – inputs name
- Returns:
imports, python code, both as strings
- 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.
- __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.
- run(x, attributes=None, verbose=0, fLOG=None)#
Calls method
_run
.
- 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.
- class OpRunCustomSchema(cls)#
Bases:
OperatorSchema
Custom schema.
- __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.
- 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.
- __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.
- __init__(onnx_node, desc=None, expected_attributes=None, **options)#
- run(x, attributes=None, verbose=0, fLOG=None)#
Calls method
_run
.
- 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.
- __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
.
- 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
- __init__(name)#
- __repr__()#
usual
- exception mlprodict.onnxrt.ops_cpu._op.RuntimeTypeError#
Bases:
RuntimeError
Raised when a type of a variable is unexpected.
- mlprodict.onnxrt.ops_cpu._op._build_schemas()#