module npy.onnx_variable
#
Short summary#
module mlprodict.npy.onnx_variable
Classes#
class |
truncated documentation |
---|---|
Class used to return multiple |
|
Variables used into onnx computation. |
Properties#
property |
truncated documentation |
---|---|
Returns self.onxvar.inputs. |
|
Returns self.onxvar.onnx_op. |
|
Returns self.onxvar.onnx_op_kwargs. |
|
Shape |
|
Size |
|
Transpose. |
Methods#
method |
truncated documentation |
---|---|
Addition. |
|
And. |
|
Equality. |
|
Division, no difference between / and //. |
|
Greater or Equal. |
|
Returns the ith elements. |
|
Deals with multiple scenarios. |
|
Greater. |
|
constructor |
|
not. |
|
Less or Equal. |
|
Less. |
|
Matrix multiplication. |
|
Modulo. |
|
Multiplication. |
|
Difference. |
|
Neg. |
|
And. |
|
Power. |
|
Right Addition. |
|
usual |
|
Right multiplication. |
|
Right subtraction. |
|
Division, no difference between / and //. |
|
Only supports vectors (1D tensor). |
|
Subtraction. |
|
Division, no difference between / and //. |
|
This could be handled before a call to this method but this method can change the conversion of an non-existing … |
|
This could be handled before a call to this method but this method can change the conversion of an non-existing … |
|
Guesses dtype when not specified. |
|
Guesses dtype when not specified. |
|
Converts y into an array if not. |
|
Cast |
|
Returns a copy of self (use of Identity node). |
|
Flattens a matrix (see numpy.ndarray.flatten). |
|
Not. |
|
Reshape |
|
Forces this variable to get this name during |
|
Converts the variable into an operator. |
|
Converts the variable into an operator. |
Documentation#
Intermediate class between numpy and onnx.
New in version 0.6.
- class mlprodict.npy.onnx_variable.MultiOnnxVar(*inputs, op=None, dtype=None, **kwargs)#
Bases:
object
Class used to return multiple
OnnxVar
at the same time.constructor
- __getitem__(index)#
Returns the ith elements.
- __init__(*inputs, op=None, dtype=None, **kwargs)#
constructor
- _guess_dtype(dtype)#
Guesses dtype when not specified.
- property inputs#
Returns self.onxvar.inputs.
- property onnx_op#
Returns self.onxvar.onnx_op.
- property onnx_op_kwargs#
Returns self.onxvar.onnx_op_kwargs.
- to_algebra(op_version=None)#
Converts the variable into an operator.
- class mlprodict.npy.onnx_variable.OnnxVar(*inputs, op=None, select_output=None, dtype=None, **kwargs)#
Bases:
object
Variables used into onnx computation.
- Parameters:
inputs – variable name or object
op – ONNX operator
select_output – if multiple output are returned by ONNX operator op, it takes only one specifed by this argument
dtype – specifies the type of the variable held by this class (op is None) in that case
kwargs – addition argument to give operator op
New in version 0.6.
- property T#
Transpose.
- __add__(y)#
Addition.
- __and__(y)#
And.
- __array_ufunc__ = None#
- __eq__(y)#
Equality.
- __floordiv__(y)#
Division, no difference between / and //.
- __ge__(y)#
Greater or Equal.
- __getitem__(index)#
Deals with multiple scenarios.
index is an integer or a slice, a tuple of integers and slices, example: [0, 1], [:5, :6], [::2] (scenario 1)
index is an ONNX object (more precisely an instance of
OnnxVar
), then the method assumes it is an array of boolean to select a subset of the tensor along the first axis, example: mat[mat == 0] (scenario 2)
- __gt__(y)#
Greater.
- __hash__ = None#
- __init__(*inputs, op=None, select_output=None, dtype=None, **kwargs)#
- __invert__()#
not.
- __le__(y)#
Less or Equal.
- __lt__(y)#
Less.
- __matmul__(y)#
Matrix multiplication.
- __mod__(y)#
Modulo.
- __mul__(y)#
Multiplication.
- __ne__(y)#
Difference.
- __neg__()#
Neg.
- __or__(y)#
And.
- __pow__(y)#
Power.
- __radd__(y)#
Right Addition.
- __repr__()#
usual
- __rmul__(y)#
Right multiplication.
- __rsub__(y)#
Right subtraction.
- __rtruediv__(y)#
Division, no difference between / and //.
- __setitem__(index, value)#
Only supports vectors (1D tensor).
index is an integer or a slice, a tuple of integers and slices, example: [0], [:5], [::2] (scenario 1)
index is an ONNX object (more precisely an instance of
OnnxVar
), then the method assumes it is an array of boolean to select a subset of the tensor along the first axis, example: mat[mat == 0] (scenario 2)
This processing is applied before the operator it contains. A copy should be made (Identity node or copy method).
- __sub__(y)#
Subtraction.
- __truediv__(y)#
Division, no difference between / and //.
- _custom_op(*args, op_version=None, runtime=None, **kwargs)#
This could be handled before a call to this method but this method can change the conversion of an non-existing operator depending on the given opset.
- _custom_op_filter(*args, op_version=None, runtime=None, **kwargs)#
This could be handled before a call to this method but this method can change the conversion of an non-existing operator depending on the given opset.
- _guess_dtype(dtype, from_init=False)#
Guesses dtype when not specified.
- _make_array(y)#
Converts y into an array if not.
- _setitem1i_(index, value)#
- _setitem2i_(index, value)#
- astype(dtype)#
Cast
- copy()#
Returns a copy of self (use of Identity node).
- flatten(axis=0)#
Flattens a matrix (see numpy.ndarray.flatten).
- Parameters:
axis – only flatten from axis to the end.
- Returns:
- not_()#
Not.
- reshape(shape)#
Reshape
- set_onnx_name(name_type)#
Forces this variable to get this name during
- Parameters:
name_type – a tuple (name, type)
- property shape#
Shape
- property size#
Size
- to_algebra(op_version=None)#
Converts the variable into an operator.