module npy.onnx_numpy_wrapper#

Inheritance diagram of mlprodict.npy.onnx_numpy_wrapper

Short summary#

module mlprodict.npy.onnx_numpy_wrapper

Wraps numpy functions into onnx.

Classes#

class

truncated documentation

_created_classes

Class to store all dynamic classes created by wrappers.

wrapper_onnxnumpy

Intermediate wrapper to store a pointer on the compiler (type: OnnxNumpyCompiler).

wrapper_onnxnumpy_np

Intermediate wrapper to store a pointer on the compiler (type: OnnxNumpyCompiler) supporting multiple signatures. …

Functions#

function

truncated documentation

onnxnumpy

Decorator to declare a function implemented using numpy syntax but executed with ONNX operators. …

onnxnumpy_default

Decorator with options to declare a function implemented using numpy syntax but executed with ONNX

onnxnumpy_np

Decorator to declare a function implemented using numpy syntax but executed with ONNX operators. …

Methods#

method

truncated documentation

__call__

Calls the compiled function with arguments args.

__call__

Calls the compiled function assuming the type of the first tensor in args defines the templated version of the …

__getitem__

Returns the instance of wrapper_onnxnumpy mapped to dtype.

__getstate__

Serializes everything but the function which generates the ONNX graph, not needed anymore.

__getstate__

Serializes everything but the function which generates the ONNX graph, not needed anymore.

__init__

__init__

__init__

__setstate__

Serializes everything but the function which generates the ONNX graph, not needed anymore.

__setstate__

Restores serialized data.

_populate

Creates the appropriate runtime for function fct

_validate_onnx_data

append

Adds a class into globals() to enable pickling on dynamic classes.

to_onnx

Returns the ONNX graph for the wrapped function. It takes additional arguments to distinguish between multiple graphs. …

to_onnx

Returns the ONNX graph for the wrapped function. It takes additional arguments to distinguish between multiple graphs. …

Documentation#

Wraps numpy functions into onnx.

New in version 0.6.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper._created_classes#

Bases: object

Class to store all dynamic classes created by wrappers.

source on GitHub

__init__()#
append(name, cl)#

Adds a class into globals() to enable pickling on dynamic classes.

source on GitHub

mlprodict.npy.onnx_numpy_wrapper.onnxnumpy(op_version=None, runtime=None, signature=None)#

Decorator to declare a function implemented using numpy syntax but executed with ONNX operators.

Parameters:
  • op_versionONNX opset version

  • runtime‘onnxruntime’ or one implemented by OnnxInference

  • signature – it should be used when the function is not annoatated.

Equivalent to onnxnumpy(arg)(foo).

New in version 0.6.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_custom_fct_None_None(compiled)#

Bases: wrapper_onnxnumpy

onnx numpy abs

__fct__() <mlprodict.npy.onnx_numpy_annotation.NDArray.ShapeType object at 0x7f7667ba5880>#

onnx numpy abs

__name__ = 'onnxnumpy_custom_fct_None_None'#
mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_default(fct)#

Decorator with options to declare a function implemented using numpy syntax but executed with ONNX operators.

Parameters:

fct – function to wrap

New in version 0.6.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_abs_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

abs

__fct__()#

abs

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_abs_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_acos_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

acos

__fct__()#

acos

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_acos_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_acosh_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

acosh

__fct__()#

acosh

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_acosh_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_amax_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

amax

__fct__(axis=None, keepdims=0)#

amax

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_amax_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_amin_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

amin

__fct__(axis=None, keepdims=0)#

amin

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_amin_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_arange_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

arange, start, stop must be specified.

__fct__(stop, step=1)#

arange, start, stop must be specified.

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_arange_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_argmax_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

argmax

__fct__(axis=0, keepdims=0)#

argmax

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_argmax_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_argmin_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

argmin

__fct__(axis=0, keepdims=0)#

argmin

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_argmin_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_asin_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

asin

__fct__()#

asin

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_asin_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_asinh_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

asinh

__fct__()#

asinh

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_asinh_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_atan_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

atan

__fct__()#

atan

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_atan_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_atanh_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

atanh

__fct__()#

atanh

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_atanh_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_ceil_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

ceil

__fct__()#

ceil

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_ceil_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_clip_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

clip

__fct__(a_min=None, a_max=None)#

clip

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_clip_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_compress_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

compress

__fct__(x, axis=None)#

compress

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_compress_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_concat_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

concat

__fct__(*, axis=0)#

concat

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_concat_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_cos_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

cos

__fct__()#

cos

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_cos_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_cosh_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

cosh

__fct__()#

cosh

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_cosh_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_cumsum_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

cumsum

__fct__(axis)#

cumsum

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_cumsum_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_det_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

det

__fct__()#

det

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_det_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_dot_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

dot

__fct__(b)#

dot

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_dot_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_einsum_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

einsum

__fct__(*, equation=None)#

einsum

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_einsum_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_erf_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

erf

__fct__()#

erf

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_erf_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_exp_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

exp

__fct__()#

exp

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_exp_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_expand_dims_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

expand_dims

__fct__(axis=0)#

expand_dims

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_expand_dims_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_expit_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

expit

__fct__()#

expit

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_expit_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_floor_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

floor

__fct__()#

floor

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_floor_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_hstack_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

hstack

__fct__()#

hstack

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_hstack_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_isnan_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

isnan

__fct__()#

isnan

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_isnan_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_log1p_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

log1p

__fct__()#

log1p

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_log1p_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_log_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

log

__fct__()#

log

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_log_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_logistic_regression_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

logistic_regression

__fct__(*, model=None)#

logistic_regression

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_logistic_regression_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_matmul_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

matmul

__fct__(b)#

matmul

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_matmul_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_mean_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

mean

__fct__(axis=None, keepdims=0)#

mean

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_mean_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_onnx_cube_32_None_onnxruntime(**kwargs)#

Bases: wrapper_onnxnumpy_np

__fct__()#
__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_onnx_cube_32_None_onnxruntime'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_onnx_rel_diff_32_None_onnxruntime(**kwargs)#

Bases: wrapper_onnxnumpy_np

__fct__(b)#
__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_onnx_rel_diff_32_None_onnxruntime'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_onnx_sq_diff_32_None_onnxruntime(**kwargs)#

Bases: wrapper_onnxnumpy_np

__fct__(b)#
__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_onnx_sq_diff_32_None_onnxruntime'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_onnx_square_32_None_onnxruntime(**kwargs)#

Bases: wrapper_onnxnumpy_np

__fct__()#
__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_onnx_square_32_None_onnxruntime'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_onnx_sum_32_None_onnxruntime(**kwargs)#

Bases: wrapper_onnxnumpy_np

__fct__(b)#
__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_onnx_sum_32_None_onnxruntime'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_pad_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

pad

__fct__(pads, constant_value=None, mode='constant')#

pad

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_pad_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_prod_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

prod

__fct__(axis=None, keepdims=0)#

prod

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_prod_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_reciprocal_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

reciprocal

__fct__()#

reciprocal

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_reciprocal_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_relu_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

relu

__fct__()#

relu

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_relu_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_round_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

round

__fct__()#

round

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_round_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_sigmoid_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

expit

__fct__()#

expit

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_sigmoid_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_sign_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

sign

__fct__()#

sign

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_sign_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_sin_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

sin

__fct__()#

sin

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_sin_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_sinh_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

sinh

__fct__()#

sinh

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_sinh_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_sqrt_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

sqrt

__fct__()#

sqrt

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_sqrt_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_squeeze_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

squeeze

__fct__(axis=None)#

squeeze

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_squeeze_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_sum_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

sum

__fct__(axis=None, keepdims=0)#

sum

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_sum_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_tan_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

tan

__fct__()#

tan

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_tan_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_tanh_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

tanh

__fct__()#

tanh

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_tanh_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_topk_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

topk

__fct__(k, axis=-1, largest=1, sorted=1)#

topk

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_topk_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_transpose_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

transpose

__fct__(perm=(1, 0))#

transpose

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_transpose_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_unsqueeze_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

unsqueeze

__fct__(axes)#

unsqueeze

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_unsqueeze_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_vstack_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

vstack

__fct__()#

vstack

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_vstack_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_nb_where_None_None(**kwargs)#

Bases: wrapper_onnxnumpy_np

where

__fct__(x, y)#

where

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__name__ = 'onnxnumpy_nb_where_None_None'#
__setstate__(state)#

Restores serialized data.

source on GitHub

mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_np(op_version=None, runtime=None, signature=None)#

Decorator to declare a function implemented using numpy syntax but executed with ONNX operators.

Parameters:
  • op_versionONNX opset version

  • runtime‘onnxruntime’ or one implemented by OnnxInference

  • signature – it should be used when the function is not annoatated.

Equivalent to onnxnumpy(arg)(foo).

New in version 0.6.

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_onnx_exp_1_None_None(compiled)#

Bases: wrapper_onnxnumpy

__fct__() <mlprodict.npy.onnx_numpy_annotation.NDArray.ShapeType object at 0x7f76e85ba850>#
__name__ = 'onnxnumpy_onnx_exp_1_None_None'#
class mlprodict.npy.onnx_numpy_wrapper.onnxnumpy_onnx_log_1_None_None(compiled)#

Bases: wrapper_onnxnumpy

__fct__() <mlprodict.npy.onnx_numpy_annotation.NDArray.ShapeType object at 0x7f76e85baa00>#
__name__ = 'onnxnumpy_onnx_log_1_None_None'#
class mlprodict.npy.onnx_numpy_wrapper.wrapper_onnxnumpy(compiled)#

Bases: object

Intermediate wrapper to store a pointer on the compiler (type: OnnxNumpyCompiler).

Parameters:

compiled – instance of OnnxNumpyCompiler

New in version 0.6.

source on GitHub

__call__(*args, **kwargs)#

Calls the compiled function with arguments args.

source on GitHub

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__init__(compiled)#
__setstate__(state)#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

to_onnx(**kwargs)#

Returns the ONNX graph for the wrapped function. It takes additional arguments to distinguish between multiple graphs. This happens when a function needs to support multiple type.

Returns:

ONNX graph

source on GitHub

class mlprodict.npy.onnx_numpy_wrapper.wrapper_onnxnumpy_np(**kwargs)#

Bases: object

Intermediate wrapper to store a pointer on the compiler (type: OnnxNumpyCompiler) supporting multiple signatures.

New in version 0.6.

source on GitHub

__call__(*args, **kwargs)#

Calls the compiled function assuming the type of the first tensor in args defines the templated version of the function to convert into ONNX.

source on GitHub

__getitem__(dtype)#

Returns the instance of wrapper_onnxnumpy mapped to dtype.

Parameters:

dtype – numpy dtype corresponding to the input dtype of the function

Returns:

instance of wrapper_onnxnumpy

source on GitHub

__getstate__()#

Serializes everything but the function which generates the ONNX graph, not needed anymore.

source on GitHub

__init__(**kwargs)#
__setstate__(state)#

Restores serialized data.

source on GitHub

_populate(version)#

Creates the appropriate runtime for function fct

source on GitHub

_validate_onnx_data(X)#
to_onnx(**kwargs)#

Returns the ONNX graph for the wrapped function. It takes additional arguments to distinguish between multiple graphs. This happens when a function needs to support multiple type.

Returns:

ONNX graph

source on GitHub