id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16,000 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_celu.py | onnx.reference.ops.op_celu.Celu | from onnx.reference.op_run import OpRun
class Celu(OpRun):
def _run(self, x, alpha=None):
return (_vcelu1(x, alpha).astype(x.dtype),) |
class Celu(OpRun):
def _run(self, x, alpha=None):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,001 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_center_crop_pad.py | onnx.reference.ops.op_center_crop_pad.CenterCropPad | from onnx.reference.op_run import OpRun
import numpy as np
class CenterCropPad(OpRun):
def _run(self, input_data, shape, axes=None):
axes = axes or self.axes
input_rank = len(input_data.shape)
if axes is None:
axes = list(range(input_rank))
else:
axes = [axi... |
class CenterCropPad(OpRun):
def _run(self, input_data, shape, axes=None):
pass | 2 | 0 | 39 | 1 | 38 | 3 | 8 | 0.08 | 1 | 5 | 0 | 0 | 1 | 0 | 1 | 40 | 40 | 1 | 39 | 12 | 37 | 3 | 34 | 12 | 32 | 8 | 5 | 3 | 8 |
16,002 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_clip.py | onnx.reference.ops.op_clip.Clip_11 | from onnx.reference.op_run import OpRun
import numpy as np
class Clip_11(OpRun):
def _run(self, data, *minmax):
le = len(minmax)
amin = minmax[0] if le > 0 else None
amax = minmax[1] if le > 1 else None
res = data if amin is amax is None else np.clip(data, amin, amax)
res =... |
class Clip_11(OpRun):
def _run(self, data, *minmax):
pass | 2 | 0 | 7 | 0 | 7 | 1 | 5 | 0.13 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 8 | 0 | 8 | 6 | 6 | 1 | 8 | 6 | 6 | 5 | 5 | 0 | 5 |
16,003 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_clip.py | onnx.reference.ops.op_clip.Clip_6 | from onnx.reference.op_run import OpRun
import numpy as np
class Clip_6(OpRun):
def _run(self, data, min=None, max=None):
amin = min
amax = max
res = data if amin is amax is None else np.clip(data, amin, amax)
return (res,) if res.dtype == data.dtype else (res.astype(data.dtype),) |
class Clip_6(OpRun):
def _run(self, data, min=None, max=None):
pass | 2 | 0 | 5 | 0 | 5 | 2 | 3 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 6 | 0 | 6 | 5 | 4 | 2 | 6 | 5 | 4 | 3 | 5 | 0 | 3 |
16,004 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_col2im.py | onnx.reference.ops.op_col2im.Col2Im | import numpy as np
from onnx.reference.op_run import OpRun
class Col2Im(OpRun):
def _run(self, data, image_shape, block_shape, dilations=None, pads=None, strides=None):
if dilations is None:
dilations = [1 for s in image_shape]
if pads is None:
pads = [0 for s in image_shap... |
class Col2Im(OpRun):
def _run(self, data, image_shape, block_shape, dilations=None, pads=None, strides=None):
pass | 2 | 0 | 26 | 2 | 24 | 2 | 7 | 0.08 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 40 | 27 | 2 | 25 | 13 | 21 | 2 | 21 | 10 | 19 | 7 | 5 | 3 | 7 |
16,005 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_compress.py | onnx.reference.ops.op_compress.Compress | from onnx.reference.op_run import OpRun
import numpy as np
class Compress(OpRun):
def _run(self, x, condition, axis=None):
return (np.compress(condition, x, axis=axis),) |
class Compress(OpRun):
def _run(self, x, condition, axis=None):
pass | 2 | 0 | 2 | 0 | 2 | 2 | 1 | 0.67 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 3 | 0 | 3 | 2 | 1 | 2 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,006 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_concat.py | onnx.reference.ops.op_concat.Concat | import numpy as np
from onnx.reference.op_run import OpRun
class Concat(OpRun):
def _preprocess(self, a: np.ndarray, axis: int) -> np.ndarray:
if len(a.shape) == 0:
raise RuntimeError(f'Concat: one input has an empty shape: {a!r}.')
if axis >= len(a.shape):
new_shape = a.sh... |
class Concat(OpRun):
def _preprocess(self, a: np.ndarray, axis: int) -> np.ndarray:
pass
def _run(self, *args, axis=None):
pass | 3 | 0 | 5 | 0 | 5 | 2 | 2 | 0.36 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 41 | 12 | 1 | 11 | 5 | 8 | 4 | 11 | 5 | 8 | 3 | 5 | 1 | 4 |
16,007 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_concat_from_sequence.py | onnx.reference.ops.op_concat_from_sequence.ConcatFromSequence | from onnx.reference.op_run import OpRun
class ConcatFromSequence(OpRun):
def _run(self, seq, axis=None, new_axis=None):
if seq is None:
raise RuntimeError('A sequence cannot be null.')
res = _concat_from_sequence(seq, axis, new_axis=new_axis)
return (res,) |
class ConcatFromSequence(OpRun):
def _run(self, seq, axis=None, new_axis=None):
pass | 2 | 0 | 5 | 0 | 5 | 1 | 2 | 0.17 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 6 | 0 | 6 | 3 | 4 | 1 | 6 | 3 | 4 | 2 | 5 | 1 | 2 |
16,008 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_constant.py | onnx.reference.ops.op_constant.ConstantCommon | from onnx.reference.op_run import OpRun, RefAttrName
class ConstantCommon(OpRun):
def _check(self, cst):
if isinstance(cst, tuple):
raise TypeError(f'Unexpected type {type(cst)} for a constant.')
return cst |
class ConstantCommon(OpRun):
def _check(self, cst):
pass | 2 | 0 | 4 | 0 | 4 | 1 | 2 | 0.2 | 1 | 2 | 0 | 3 | 1 | 0 | 1 | 40 | 5 | 0 | 5 | 2 | 3 | 1 | 5 | 2 | 3 | 2 | 5 | 1 | 2 |
16,009 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_constant.py | onnx.reference.ops.op_constant.Constant_1 | class Constant_1(ConstantCommon):
def __init__(self, onnx_node, run_params):
ConstantCommon.__init__(self, onnx_node, run_params)
self.cst = self.value
_check_dtype(self.cst)
def _run(self, **overridden_attributes):
if overridden_attributes and (len(overridden_attributes) > 1 o... | class Constant_1(ConstantCommon):
def __init__(self, onnx_node, run_params):
pass
def _run(self, **overridden_attributes):
pass | 3 | 0 | 7 | 0 | 7 | 2 | 2 | 0.2 | 1 | 1 | 0 | 1 | 2 | 1 | 2 | 42 | 16 | 1 | 15 | 4 | 12 | 3 | 9 | 4 | 6 | 2 | 6 | 1 | 3 |
16,010 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_constant.py | onnx.reference.ops.op_constant.Constant_11 | class Constant_11(ConstantCommon):
def __init__(self, onnx_node, run_params):
ConstantCommon.__init__(self, onnx_node, run_params)
if getattr(self, 'sparse_value', None) is None:
self.cst = self.value
else:
self.cst = self.sparse_value
_check_dtype(self.cst)
... | class Constant_11(ConstantCommon):
def __init__(self, onnx_node, run_params):
pass
def _run(self, **overridden_attributes):
pass | 3 | 0 | 9 | 0 | 9 | 2 | 2 | 0.22 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 42 | 19 | 1 | 18 | 4 | 15 | 4 | 11 | 4 | 8 | 2 | 6 | 1 | 4 |
16,011 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_constant.py | onnx.reference.ops.op_constant.Constant_12 | import numpy as np
from onnx.reference.op_run import OpRun, RefAttrName
class Constant_12(ConstantCommon):
def __init__(self, onnx_node, run_params):
ConstantCommon.__init__(self, onnx_node, run_params)
if hasattr(self, 'sparse_value') and self.sparse_value is not None:
self.cst_name =... |
class Constant_12(ConstantCommon):
def __init__(self, onnx_node, run_params):
pass
def _run(self, **overridden_attributes):
pass | 3 | 0 | 25 | 0 | 25 | 6 | 6 | 0.24 | 1 | 4 | 1 | 0 | 2 | 3 | 2 | 42 | 52 | 1 | 51 | 9 | 48 | 12 | 30 | 9 | 27 | 7 | 6 | 3 | 12 |
16,012 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_constant.py | onnx.reference.ops.op_constant.Constant_9 | class Constant_9(Constant_1):
def __init__(self, onnx_node, run_params):
Constant_1.__init__(self, onnx_node, run_params) | class Constant_9(Constant_1):
def __init__(self, onnx_node, run_params):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 43 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,013 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_constant_of_shape.py | onnx.reference.ops.op_constant_of_shape.ConstantOfShape | import numpy as np
from onnx.reference.op_run import OpRun
class ConstantOfShape(OpRun):
def _run(self, data, value: np.array | None=None):
if self.value is None:
value = np.array(0, dtype=np.float32)
else:
if self.value.size != 1:
raise ValueError(f"Operato... |
class ConstantOfShape(OpRun):
def _run(self, data, value: np.array | None=None):
pass | 2 | 0 | 10 | 0 | 10 | 3 | 4 | 0.29 | 1 | 5 | 0 | 0 | 2 | 1 | 2 | 41 | 22 | 1 | 21 | 6 | 18 | 6 | 14 | 5 | 11 | 5 | 5 | 1 | 7 |
16,014 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_conv.py | onnx.reference.ops.op_conv.Conv | from onnx.reference.op_run import OpRun
class Conv(OpRun):
def _run(self, X, W, B=None, auto_pad=None, dilations=None, group=None, kernel_shape=None, pads=None, strides=None):
if len(X.shape) < 3:
raise ValueError(f'X must have at least 3 dimensions but its shape is {X.shape}.')
return... |
class Conv(OpRun):
def _run(self, X, W, B=None, auto_pad=None, dilations=None, group=None, kernel_shape=None, pads=None, strides=None):
pass | 2 | 0 | 22 | 0 | 21 | 2 | 2 | 0.09 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 23 | 0 | 22 | 13 | 9 | 2 | 5 | 2 | 3 | 2 | 5 | 1 | 2 |
16,015 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_conv_integer.py | onnx.reference.ops.op_conv_integer.ConvInteger | from onnx.reference.op_run import OpRun
from onnx.reference.ops.op_conv import _conv_implementation
import numpy as np
class ConvInteger(OpRun):
def _run(self, X, W, x_zero_point=None, w_zero_point=None, auto_pad=None, dilations=None, group=None, kernel_shape=None, pads=None, strides=None):
if len(X.shape... |
class ConvInteger(OpRun):
def _run(self, X, W, x_zero_point=None, w_zero_point=None, auto_pad=None, dilations=None, group=None, kernel_shape=None, pads=None, strides=None):
pass | 2 | 0 | 36 | 2 | 34 | 7 | 4 | 0.2 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 37 | 2 | 35 | 14 | 21 | 7 | 17 | 2 | 15 | 4 | 5 | 1 | 4 |
16,016 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_conv_transpose.py | onnx.reference.ops.op_conv_transpose.ConvTranspose | from onnx.reference.ops.op_col2im import col2im_naive_implementation
import numpy as np
from onnx.reference.op_run import OpRun
class ConvTranspose(OpRun):
def _run(self, X, W, B=None, auto_pad=None, dilations=None, group=None, kernel_shape=None, output_padding=None, output_shape=None, pads=None, strides=None):
... |
class ConvTranspose(OpRun):
def _run(self, X, W, B=None, auto_pad=None, dilations=None, group=None, kernel_shape=None, output_padding=None, output_shape=None, pads=None, strides=None):
pass | 2 | 0 | 127 | 7 | 118 | 7 | 19 | 0.06 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 128 | 7 | 119 | 42 | 104 | 7 | 65 | 27 | 63 | 19 | 5 | 4 | 19 |
16,017 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_cos.py | onnx.reference.ops.op_cos.Cos | import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class Cos(OpRunUnaryNum):
def _run(self, x):
return (np.cos(x),) |
class Cos(OpRunUnaryNum):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,018 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_cosh.py | onnx.reference.ops.op_cosh.Cosh | import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class Cosh(OpRunUnaryNum):
def _run(self, x):
return (np.cosh(x),) |
class Cosh(OpRunUnaryNum):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,019 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_cum_sum.py | onnx.reference.ops.op_cum_sum.CumSum | from onnx.reference.op_run import OpRun
import numpy as np
class CumSum(OpRun):
def _run(self, x, axis, exclusive=None, reverse=None):
if not isinstance(axis, (np.int32, np.int64)):
if len(axis.shape) > 1 or (len(axis.shape) > 0 and axis.shape[0] != 1):
raise RuntimeError(f'axi... |
class CumSum(OpRun):
def _run(self, x, axis, exclusive=None, reverse=None):
pass | 2 | 0 | 24 | 0 | 24 | 9 | 7 | 0.36 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 40 | 25 | 0 | 25 | 6 | 23 | 9 | 22 | 6 | 20 | 7 | 5 | 2 | 7 |
16,020 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_deform_conv.py | onnx.reference.ops.op_deform_conv.DeformConv | from onnx.reference.op_run import OpRun
class DeformConv(OpRun):
def _run(self, X, W, offset, B=None, mask=None, dilations=None, group=None, kernel_shape=None, offset_group=None, pads=None, strides=None):
if len(X.shape) < 3:
raise ValueError(f'X must have at least 3 dimensions but its shape i... |
class DeformConv(OpRun):
def _run(self, X, W, offset, B=None, mask=None, dilations=None, group=None, kernel_shape=None, offset_group=None, pads=None, strides=None):
pass | 2 | 0 | 33 | 0 | 33 | 1 | 2 | 0.03 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 34 | 0 | 34 | 15 | 19 | 1 | 5 | 2 | 3 | 2 | 5 | 1 | 2 |
16,021 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_depth_to_space.py | onnx.reference.ops.op_depth_to_space.DepthToSpace | from onnx.reference.op_run import OpRun
import numpy as np
class DepthToSpace(OpRun):
def _run(self, data, blocksize=None, mode=None):
if len(data.shape) != 4:
raise RuntimeError(f'Unexpected shape {data.shape!r}.')
b, c, h, w = data.shape
if mode == 'DCR':
tmpshape... |
class DepthToSpace(OpRun):
def _run(self, data, blocksize=None, mode=None):
pass | 2 | 0 | 35 | 0 | 34 | 2 | 3 | 0.06 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 36 | 0 | 35 | 8 | 33 | 2 | 15 | 8 | 13 | 3 | 5 | 1 | 3 |
16,022 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dequantize_linear.py | onnx.reference.ops.op_dequantize_linear.DequantizeLinear_19 | class DequantizeLinear_19(_CommonDequantizeLinear):
def _run(self, x, x_scale, x_zero_point=None, axis: int=1):
if len(x_scale.shape) > 1:
raise ValueError('Input 2 must be a vector or a number.')
return super()._run(x, x_scale, x_zero_point, axis) | class DequantizeLinear_19(_CommonDequantizeLinear):
def _run(self, x, x_scale, x_zero_point=None, axis: int=1):
pass | 2 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 42 | 5 | 0 | 5 | 2 | 3 | 0 | 5 | 2 | 3 | 2 | 6 | 1 | 2 |
16,023 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dequantize_linear.py | onnx.reference.ops.op_dequantize_linear.DequantizeLinear_21 | class DequantizeLinear_21(_CommonDequantizeLinear):
def _run(self, *args, axis: int=1, block_size: int=0):
return super()._run(*args, axis=axis, block_size=block_size) | class DequantizeLinear_21(_CommonDequantizeLinear):
def _run(self, *args, axis: int=1, block_size: int=0):
pass | 2 | 0 | 3 | 0 | 2 | 3 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 42 | 4 | 0 | 3 | 2 | 1 | 3 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,024 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dequantize_linear.py | onnx.reference.ops.op_dequantize_linear.DequantizeLinear_23 | class DequantizeLinear_23(_CommonDequantizeLinear):
def _run(self, *args, axis: int=1, block_size: int=0, output_dtype=None):
return super()._run(*args, axis=axis, block_size=block_size, output_dtype=output_dtype) | class DequantizeLinear_23(_CommonDequantizeLinear):
def _run(self, *args, axis: int=1, block_size: int=0, output_dtype=None):
pass | 2 | 0 | 5 | 0 | 4 | 3 | 1 | 0.6 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 42 | 6 | 0 | 5 | 2 | 3 | 3 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,025 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dequantize_linear.py | onnx.reference.ops.op_dequantize_linear._CommonDequantizeLinear | from onnx.helper import np_dtype_to_tensor_dtype, tensor_dtype_to_np_dtype
from onnx import TensorProto
from onnx.reference.op_run import OpRun
import numpy as np
class _CommonDequantizeLinear(OpRun):
def _run(self, x: np.ndarray, x_scale: np.ndarray, x_zero_point: np.ndarray | None=None, axis: int=1, block_size:... |
class _CommonDequantizeLinear(OpRun):
def _run(self, x: np.ndarray, x_scale: np.ndarray, x_zero_point: np.ndarray | None=None, axis: int=1, block_size: int=0, output_dtype: int | None=None):
pass | 2 | 0 | 39 | 1 | 39 | 1 | 10 | 0.01 | 1 | 2 | 0 | 3 | 2 | 0 | 2 | 41 | 80 | 2 | 78 | 20 | 67 | 1 | 36 | 12 | 33 | 11 | 5 | 3 | 19 |
16,026 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_det.py | onnx.reference.ops.op_det.Det | import numpy as np
from onnx.reference.op_run import OpRun
class Det(OpRun):
def _run(self, x):
return (np.array(np.linalg.det(x)),) |
class Det(OpRun):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,027 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dft.py | onnx.reference.ops.op_dft.DFT_17 | import numpy as np
from onnx.reference.op_run import OpRun
class DFT_17(OpRun):
def _run(self, x: np.ndarray, dft_length: int | None=None, axis: int=1, inverse: bool=False, onesided: bool=False) -> tuple[np.ndarray]:
axis = axis % len(x.shape)
if dft_length is None:
dft_length = x.shap... |
class DFT_17(OpRun):
def _run(self, x: np.ndarray, dft_length: int | None=None, axis: int=1, inverse: bool=False, onesided: bool=False) -> tuple[np.ndarray]:
pass | 2 | 0 | 17 | 0 | 16 | 3 | 3 | 0.18 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 40 | 18 | 0 | 17 | 10 | 8 | 3 | 9 | 3 | 7 | 3 | 5 | 1 | 3 |
16,028 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dft.py | onnx.reference.ops.op_dft.DFT_20 | import numpy as np
from onnx.reference.op_run import OpRun
class DFT_20(OpRun):
def _run(self, x: np.ndarray, dft_length: int | None=None, axis: int=-2, inverse: bool=False, onesided: bool=False) -> tuple[np.ndarray]:
axis = axis % len(x.shape)
if dft_length is None:
dft_length = x.sha... |
class DFT_20(OpRun):
def _run(self, x: np.ndarray, dft_length: int | None=None, axis: int=-2, inverse: bool=False, onesided: bool=False) -> tuple[np.ndarray]:
pass | 2 | 0 | 17 | 0 | 16 | 3 | 3 | 0.18 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 40 | 18 | 0 | 17 | 10 | 8 | 3 | 9 | 3 | 7 | 3 | 5 | 1 | 3 |
16,029 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_div.py | onnx.reference.ops.op_div.Div | from onnx.reference.ops._op import OpRunBinaryNumpy
import numpy as np
class Div(OpRunBinaryNumpy):
def __init__(self, onnx_node, run_params):
def func(x, y):
if issubclass(x.dtype.type, np.integer):
assert issubclass(y.dtype.type, np.integer)
return x // y
... |
class Div(OpRunBinaryNumpy):
def __init__(self, onnx_node, run_params):
pass
def func(x, y):
pass
def _run(self, a, b):
pass | 4 | 0 | 4 | 0 | 4 | 1 | 2 | 0.25 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 45 | 9 | 1 | 8 | 4 | 5 | 2 | 8 | 4 | 5 | 2 | 8 | 1 | 3 |
16,030 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dropout.py | onnx.reference.ops.op_dropout.DropoutBase | from onnx.reference.op_run import OpRun
import numpy as np
class DropoutBase(OpRun):
def __init__(self, onnx_node, run_params):
OpRun.__init__(self, onnx_node, run_params)
self.n_outputs = len(onnx_node.output)
def _private_run(self, X: np.ndarray, seed: int | None=None, ratio: float=0.5, tra... |
class DropoutBase(OpRun):
def __init__(self, onnx_node, run_params):
pass
def _private_run(self, X: np.ndarray, seed: int | None=None, ratio: float=0.5, training_mode: bool=False) -> tuple[np.ndarray]:
pass | 3 | 0 | 9 | 0 | 9 | 1 | 1 | 0.11 | 1 | 4 | 0 | 2 | 2 | 1 | 2 | 41 | 19 | 1 | 18 | 10 | 9 | 2 | 6 | 4 | 3 | 1 | 5 | 0 | 2 |
16,031 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dropout.py | onnx.reference.ops.op_dropout.Dropout_12 | class Dropout_12(DropoutBase):
def _run(self, *inputs, seed=None):
X = inputs[0]
ratio = 0.5 if len(inputs) <= 1 else inputs[1]
training_mode = False if len(inputs) <= 2 else inputs[2]
return self._private_run(X, seed=seed, ratio=ratio, training_mode=training_mode) | class Dropout_12(DropoutBase):
def _run(self, *inputs, seed=None):
pass | 2 | 0 | 10 | 0 | 10 | 2 | 3 | 0.18 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 11 | 0 | 11 | 5 | 9 | 2 | 6 | 5 | 4 | 3 | 6 | 0 | 3 |
16,032 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dropout.py | onnx.reference.ops.op_dropout.Dropout_7 | class Dropout_7(DropoutBase):
def _run(self, X, ratio=None):
return self._private_run(X, ratio) | class Dropout_7(DropoutBase):
def _run(self, X, ratio=None):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,033 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_dynamic_quantize_linear.py | onnx.reference.ops.op_dynamic_quantize_linear.DynamicQuantizeLinear | from onnx.reference.op_run import OpRun
import numpy as np
class DynamicQuantizeLinear(OpRun):
def _run(self, x):
dtype, qmin, qmax = (np.uint8, 0, 255)
maxx = np.float32(np.maximum(0, np.max(x)))
minx = np.float32(np.minimum(0, np.min(x)))
y_scale = np.float32(1.0 if maxx == minx ... |
class DynamicQuantizeLinear(OpRun):
def _run(self, x):
pass | 2 | 0 | 21 | 3 | 16 | 3 | 2 | 0.18 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 22 | 3 | 17 | 10 | 15 | 3 | 11 | 10 | 9 | 2 | 5 | 0 | 2 |
16,034 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_einsum.py | onnx.reference.ops.op_einsum.Einsum | import numpy as np
from onnx.reference.op_run import OpRun
class Einsum(OpRun):
def _run(self, *args, equation=None):
if not isinstance(equation, str):
raise TypeError(f'equation must be string but is {type(equation)!r}.')
equation = equation.strip()
if not equation:
... |
class Einsum(OpRun):
def _run(self, *args, equation=None):
pass | 2 | 0 | 10 | 0 | 10 | 1 | 4 | 0.09 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 40 | 11 | 0 | 11 | 2 | 9 | 1 | 11 | 2 | 9 | 4 | 5 | 1 | 4 |
16,035 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_elu.py | onnx.reference.ops.op_elu.Elu | import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class Elu(OpRunUnaryNum):
def _run(self, x, alpha=None):
alpha = alpha or self.alpha
return (np.where(x > 0, x, alpha * (np.exp(x) - 1)).astype(x.dtype),) |
class Elu(OpRunUnaryNum):
def _run(self, x, alpha=None):
pass | 2 | 0 | 3 | 0 | 3 | 2 | 1 | 0.5 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 4 | 0 | 4 | 2 | 2 | 2 | 4 | 2 | 2 | 1 | 7 | 0 | 1 |
16,036 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_equal.py | onnx.reference.ops.op_equal.Equal | from onnx.reference.ops._op import OpRunBinaryComparison
import numpy as np
class Equal(OpRunBinaryComparison):
def _run(self, a, b):
return (np.equal(a, b),) |
class Equal(OpRunBinaryComparison):
def _run(self, a, b):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,037 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_erf.py | onnx.reference.ops.op_erf.Erf | from math import erf
import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class Erf(OpRunUnaryNum):
def __init__(self, onnx_node, run_params):
OpRunUnaryNum.__init__(self, onnx_node, run_params)
self._erf = np.vectorize(erf, otypes=['f'])
def _run(self, x):
return (self... |
class Erf(OpRunUnaryNum):
def __init__(self, onnx_node, run_params):
pass
def _run(self, x):
pass | 3 | 0 | 3 | 0 | 3 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 43 | 7 | 1 | 6 | 4 | 3 | 2 | 6 | 4 | 3 | 1 | 7 | 0 | 2 |
16,038 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_exp.py | onnx.reference.ops.op_exp.Exp | import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class Exp(OpRunUnaryNum):
def _run(self, x):
return (np.exp(x).astype(x.dtype),) |
class Exp(OpRunUnaryNum):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,039 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_expand.py | onnx.reference.ops.op_expand.Expand | from onnx.reference.op_run import OpRun
class Expand(OpRun):
def _run(self, data, shape):
return (common_reference_implementation(data, shape),) |
class Expand(OpRun):
def _run(self, data, shape):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,040 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_eyelike.py | onnx.reference.ops.op_eyelike.EyeLike | from onnx.helper import tensor_dtype_to_np_dtype
import numpy as np
from onnx.onnx_pb import TensorProto
from onnx.reference.op_run import OpRun
class EyeLike(OpRun):
def _run(self, data, *args, dtype=None, k=None):
if dtype is None:
if data is None:
_dtype = np.float32
... |
class EyeLike(OpRun):
def _run(self, data, *args, dtype=None, k=None):
pass | 2 | 0 | 18 | 0 | 18 | 4 | 6 | 0.21 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 19 | 0 | 19 | 5 | 17 | 4 | 14 | 5 | 12 | 6 | 5 | 2 | 6 |
16,041 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_flatten.py | onnx.reference.ops.op_flatten.Flatten | from onnx.reference.ops._op import OpRunUnary
import numpy as np
class Flatten(OpRunUnary):
def _run(self, x, axis=None):
i = axis or self.axis
shape = x.shape
new_shape = (1, -1) if i == 0 else (np.prod(shape[:i]).astype(int), -1)
return (x.reshape(new_shape),) |
class Flatten(OpRunUnary):
def _run(self, x, axis=None):
pass | 2 | 0 | 5 | 0 | 5 | 3 | 2 | 0.5 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 41 | 6 | 0 | 6 | 5 | 4 | 3 | 6 | 5 | 4 | 2 | 6 | 0 | 2 |
16,042 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_floor.py | onnx.reference.ops.op_floor.Floor | from onnx.reference.ops._op import OpRunUnaryNum
import numpy as np
class Floor(OpRunUnaryNum):
def _run(self, x):
return (np.floor(x),) |
class Floor(OpRunUnaryNum):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,043 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_gather.py | onnx.reference.ops.op_gather.Gather | from onnx.reference.op_run import OpRun
import numpy as np
class Gather(OpRun):
def _run(self, x, indices, axis=None):
if not x.flags['C_CONTIGUOUS']:
x = np.ascontiguousarray(x)
if not indices.flags['C_CONTIGUOUS']:
indices = indices.ascontiguousarray()
if indices.... |
class Gather(OpRun):
def _run(self, x, indices, axis=None):
pass | 2 | 0 | 12 | 0 | 11 | 2 | 5 | 0.17 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 40 | 13 | 0 | 12 | 2 | 10 | 2 | 12 | 2 | 10 | 5 | 5 | 1 | 5 |
16,044 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_gather_elements.py | onnx.reference.ops.op_gather_elements.GatherElements | import numpy as np
from onnx.reference.op_run import OpRun
class GatherElements(OpRun):
def _run(self, data, indices, axis=None):
if indices.size == 0:
return (np.empty((0,), dtype=data.dtype),)
try:
return (gather_numpy(data, axis, indices),)
except TypeError:
... |
class GatherElements(OpRun):
def _run(self, data, indices, axis=None):
pass | 2 | 0 | 8 | 0 | 7 | 2 | 3 | 0.25 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 40 | 9 | 0 | 8 | 2 | 6 | 2 | 8 | 2 | 6 | 3 | 5 | 1 | 3 |
16,045 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_gathernd.py | onnx.reference.ops.op_gathernd.GatherND | from onnx.reference.op_run import OpRun
class GatherND(OpRun):
def _run(self, data, indices, batch_dims=None):
return _gather_nd_impl(data, indices, batch_dims) |
class GatherND(OpRun):
def _run(self, data, indices, batch_dims=None):
pass | 2 | 0 | 2 | 0 | 2 | 2 | 1 | 0.67 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 3 | 0 | 3 | 2 | 1 | 2 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,046 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_gemm.py | onnx.reference.ops.op_gemm.Gemm_6 | from onnx.reference.op_run import OpRun
class Gemm_6(OpRun):
def _run(self, a, b, c=None, alpha=None, beta=None, transA=None, transB=None, broadcast=None):
if broadcast == 0:
if transA:
_meth = _gemm11 if transB else _gemm10
else:
_meth = _gemm01 if ... |
class Gemm_6(OpRun):
def _run(self, a, b, c=None, alpha=None, beta=None, transA=None, transB=None, broadcast=None):
pass | 2 | 0 | 29 | 0 | 29 | 1 | 10 | 0.03 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 30 | 0 | 30 | 14 | 18 | 1 | 16 | 4 | 14 | 10 | 5 | 2 | 10 |
16,047 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_gemm.py | onnx.reference.ops.op_gemm.Gemm_7 | from onnx.reference.op_run import OpRun
class Gemm_7(OpRun):
def _run(self, a, b, c=None, alpha=None, beta=None, transA=None, transB=None):
if transA:
_meth = _gemm11 if transB else _gemm10
else:
_meth = _gemm01 if transB else _gemm00
return (_meth(a, b, c, alpha, b... |
class Gemm_7(OpRun):
def _run(self, a, b, c=None, alpha=None, beta=None, transA=None, transB=None):
pass | 2 | 0 | 6 | 0 | 6 | 1 | 4 | 0.14 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 7 | 0 | 7 | 3 | 5 | 1 | 6 | 3 | 4 | 4 | 5 | 1 | 4 |
16,048 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_global_average_pool.py | onnx.reference.ops.op_global_average_pool.GlobalAveragePool | from onnx.reference.op_run import OpRun
class GlobalAveragePool(OpRun):
def _run(self, x):
return (_global_average_pool(x).astype(x.dtype),) |
class GlobalAveragePool(OpRun):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,049 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_global_max_pool.py | onnx.reference.ops.op_global_max_pool.GlobalMaxPool | from onnx.reference.op_run import OpRun
class GlobalMaxPool(OpRun):
def _run(self, x):
res = _global_max_pool(x)
return (res,) |
class GlobalMaxPool(OpRun):
def _run(self, x):
pass | 2 | 0 | 3 | 0 | 3 | 1 | 1 | 0.25 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 4 | 0 | 4 | 3 | 2 | 1 | 4 | 3 | 2 | 1 | 5 | 0 | 1 |
16,050 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_greater.py | onnx.reference.ops.op_greater.Greater | from onnx.reference.ops._op import OpRunBinaryComparison
import numpy as np
class Greater(OpRunBinaryComparison):
def _run(self, a, b):
return (np.greater(a, b),) |
class Greater(OpRunBinaryComparison):
def _run(self, a, b):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,051 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_greater_or_equal.py | onnx.reference.ops.op_greater_or_equal.GreaterOrEqual | import numpy as np
from onnx.reference.ops._op import OpRunBinaryComparison
class GreaterOrEqual(OpRunBinaryComparison):
def _run(self, a, b):
return (np.greater_equal(a, b),) |
class GreaterOrEqual(OpRunBinaryComparison):
def _run(self, a, b):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,052 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_grid_sample.py | onnx.reference.ops.op_grid_sample.GridSample | from onnx.reference.ops.op_resize import _get_all_coords
from onnx.reference.op_run import OpRun
import numpy as np
import numbers
class GridSample(OpRun):
def _gs_denormalize(self, n, length: int, align_corners: bool):
if align_corners:
x = (n + 1) / 2.0 * (length - 1)
else:
... |
class GridSample(OpRun):
def _gs_denormalize(self, n, length: int, align_corners: bool):
pass
def _gs_denormalize_coordinates(self, n, dims, align_corners: bool):
pass
def _gs_reflect(self, x, x_min, x_max):
'''Reflect by the near border till within the borders
Use float ... | 18 | 2 | 20 | 1 | 16 | 4 | 3 | 0.23 | 1 | 9 | 0 | 0 | 16 | 0 | 16 | 55 | 355 | 37 | 268 | 77 | 250 | 62 | 188 | 77 | 170 | 13 | 5 | 6 | 54 |
16,053 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_gru.py | onnx.reference.ops.op_gru.CommonGRU | import numpy as np
from onnx.reference.op_run import OpRun
class CommonGRU(OpRun):
def __init__(self, onnx_node, run_params):
OpRun.__init__(self, onnx_node, run_params)
self.n_outputs = len(onnx_node.output)
self.number_of_gates = 3
def f(self, x):
return 1 / (1 + np.exp(-x))... |
class CommonGRU(OpRun):
def __init__(self, onnx_node, run_params):
pass
def f(self, x):
pass
def g(self, x):
pass
def _step(self, X, R, B, W, H_0, num_directions):
pass
def _run(self, X, W, R, B=None, sequence_lens=None, initial_h=None, activation_alpha=None, ac... | 6 | 0 | 22 | 2 | 20 | 3 | 3 | 0.14 | 1 | 1 | 0 | 1 | 5 | 2 | 5 | 44 | 117 | 15 | 101 | 48 | 79 | 14 | 63 | 32 | 57 | 9 | 5 | 2 | 17 |
16,054 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_gru.py | onnx.reference.ops.op_gru.GRU | class GRU(CommonGRU):
def __init__(self, onnx_node, run_params):
CommonGRU.__init__(self, onnx_node, run_params) | class GRU(CommonGRU):
def __init__(self, onnx_node, run_params):
pass | 2 | 0 | 2 | 0 | 2 | 2 | 1 | 0.67 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 45 | 3 | 0 | 3 | 2 | 1 | 2 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,055 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_hamming_window.py | onnx.reference.ops.op_hamming_window.HammingWindow | import numpy as np
from onnx.reference.ops._op_common_window import _CommonWindow
class HammingWindow(_CommonWindow):
"""Returns :math:`\\\\omega_n = \\\\alpha - \\\\beta \\\\cos \\\\left( \\\\frac{\\\\pi n}{N-1} \\\\right)` where *N* is the window length.
See `hamming_window <https://pytorch.org/docs/stable/... |
class HammingWindow(_CommonWindow):
'''Returns :math:`\\omega_n = \\alpha - \\beta \\cos \\left( \\frac{\\pi n}{N-1} \\right)` where *N* is the window length.
See `hamming_window <https://pytorch.org/docs/stable/generated/torch.hamming_window.html>`_.
`alpha=0.54, beta=0.46`
'''
def _run(self, siz... | 2 | 1 | 6 | 0 | 6 | 1 | 1 | 0.71 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 13 | 2 | 7 | 6 | 5 | 5 | 7 | 6 | 5 | 1 | 6 | 0 | 1 |
16,056 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_hann_window.py | onnx.reference.ops.op_hann_window.HannWindow | from onnx.reference.ops._op_common_window import _CommonWindow
import numpy as np
class HannWindow(_CommonWindow):
"""Returns :math:`\\\\omega_n = \\\\sin^2\\\\left( \\\\frac{\\\\pi n}{N-1} \\\\right)` where *N* is the window length.
See `hann_window <https://pytorch.org/docs/stable/generated/torch.hann_windo... |
class HannWindow(_CommonWindow):
'''Returns :math:`\\omega_n = \\sin^2\\left( \\frac{\\pi n}{N-1} \\right)` where *N* is the window length.
See `hann_window <https://pytorch.org/docs/stable/generated/torch.hann_window.html>`_
'''
def _run(self, size, output_datatype=None, periodic=None):
pass | 2 | 1 | 4 | 0 | 4 | 1 | 1 | 0.8 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 10 | 2 | 5 | 4 | 3 | 4 | 5 | 4 | 3 | 1 | 6 | 0 | 1 |
16,057 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_hard_sigmoid.py | onnx.reference.ops.op_hard_sigmoid.HardSigmoid | from onnx.reference.ops._op import OpRunUnaryNum
import numpy as np
class HardSigmoid(OpRunUnaryNum):
def _run(self, x, alpha=None, beta=None):
alpha = alpha or self.alpha
beta = beta or self.beta
y = np.maximum(0, np.minimum(1, x * alpha + beta)).astype(x.dtype)
return (y,) |
class HardSigmoid(OpRunUnaryNum):
def _run(self, x, alpha=None, beta=None):
pass | 2 | 0 | 5 | 0 | 5 | 3 | 1 | 0.5 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 6 | 0 | 6 | 3 | 4 | 3 | 6 | 3 | 4 | 1 | 7 | 0 | 1 |
16,058 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_hardmax.py | onnx.reference.ops.op_hardmax.Hardmax | import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class Hardmax(OpRunUnaryNum):
def _run(self, x, axis=None):
axis = axis or self.axis
if x.size == 0:
return (x,)
x_argmax = np.argmax(x, axis=axis)
y = np.zeros_like(x)
np.put_along_axis(y, np.e... |
class Hardmax(OpRunUnaryNum):
def _run(self, x, axis=None):
pass | 2 | 0 | 11 | 0 | 11 | 4 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 12 | 0 | 12 | 4 | 10 | 4 | 7 | 4 | 5 | 1 | 7 | 0 | 1 |
16,059 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_identity.py | onnx.reference.ops.op_identity.Identity | from onnx.reference.op_run import OpRun
class Identity(OpRun):
def _run(self, a):
if a is None:
return (None,)
return (a.copy(),) |
class Identity(OpRun):
def _run(self, a):
pass | 2 | 0 | 4 | 0 | 4 | 1 | 2 | 0.2 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 5 | 0 | 5 | 2 | 3 | 1 | 5 | 2 | 3 | 2 | 5 | 1 | 2 |
16,060 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_if.py | onnx.reference.ops.op_if.If | from onnx.reference.op_run import OpRun
class If(OpRun):
def __init__(self, onnx_node, run_params):
OpRun.__init__(self, onnx_node, run_params)
if 'opsets' not in self.run_params:
raise KeyError("run_params must contains key 'opsets'.")
if 'verbose' not in run_params:
... |
class If(OpRun):
def __init__(self, onnx_node, run_params):
pass
def need_context(self) -> bool:
'''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`.
... | 4 | 1 | 18 | 0 | 16 | 4 | 4 | 0.22 | 1 | 6 | 0 | 0 | 3 | 0 | 3 | 42 | 58 | 3 | 50 | 19 | 39 | 11 | 35 | 12 | 31 | 7 | 5 | 2 | 12 |
16,061 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_image_decoder.py | onnx.reference.ops.op_image_decoder.ImageDecoder | from onnx.reference.op_run import OpRun
import io
import numpy as np
class ImageDecoder(OpRun):
def _run(self, encoded: np.ndarray, pixel_format='RGB') -> tuple[np.ndarray]:
try:
import PIL.Image
except ImportError as e:
raise ImportError('Pillow must be installed to use th... |
class ImageDecoder(OpRun):
def _run(self, encoded: np.ndarray, pixel_format='RGB') -> tuple[np.ndarray]:
pass | 2 | 0 | 19 | 0 | 19 | 2 | 5 | 0.1 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 40 | 20 | 0 | 20 | 6 | 17 | 2 | 15 | 5 | 12 | 5 | 5 | 1 | 5 |
16,062 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_instance_normalization.py | onnx.reference.ops.op_instance_normalization.InstanceNormalization | import numpy as np
from onnx.reference.op_run import OpRun
class InstanceNormalization(OpRun):
def _run(self, x, s, bias, epsilon=None):
dims_x = len(x.shape)
axis = tuple(range(2, dims_x))
mean = np.mean(x, axis=axis, keepdims=True)
var = np.var(x, axis=axis, keepdims=True)
... |
class InstanceNormalization(OpRun):
def _run(self, x, s, bias, epsilon=None):
pass | 2 | 0 | 10 | 0 | 10 | 1 | 1 | 0.09 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 40 | 11 | 0 | 11 | 8 | 9 | 1 | 11 | 8 | 9 | 1 | 5 | 0 | 1 |
16,063 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_isinf.py | onnx.reference.ops.op_isinf.IsInf | from onnx.reference.op_run import OpRun
import numpy as np
class IsInf(OpRun):
def _run(self, data, detect_negative=None, detect_positive=None):
if detect_negative:
if detect_positive:
return (np.isinf(data),)
return (np.isneginf(data),)
if detect_positive:
... |
class IsInf(OpRun):
def _run(self, data, detect_negative=None, detect_positive=None):
pass | 2 | 0 | 9 | 0 | 9 | 1 | 4 | 0.1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 10 | 0 | 10 | 3 | 8 | 1 | 10 | 3 | 8 | 4 | 5 | 2 | 4 |
16,064 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_isnan.py | onnx.reference.ops.op_isnan.IsNaN | from onnx.reference.ops._op import OpRunUnary
import numpy as np
class IsNaN(OpRunUnary):
def _run(self, data):
return (np.isnan(data),) |
class IsNaN(OpRunUnary):
def _run(self, data):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,065 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_layer_normalization.py | onnx.reference.ops.op_layer_normalization.LayerNormalization | from onnx.reference.op_run import OpRun
class LayerNormalization(OpRun):
def _run(self, X, Scale, B=None, axis=None, epsilon=None, stash_type=None):
if stash_type != 1:
raise NotImplementedError(f'LayerNormalization not implemented for stash_type={stash_type} != 1.')
res = _layer_norma... |
class LayerNormalization(OpRun):
def _run(self, X, Scale, B=None, axis=None, epsilon=None, stash_type=None):
pass | 2 | 0 | 7 | 0 | 7 | 1 | 2 | 0.13 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 8 | 0 | 8 | 3 | 6 | 1 | 6 | 3 | 4 | 2 | 5 | 1 | 2 |
16,066 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_leaky_relu.py | onnx.reference.ops.op_leaky_relu.LeakyRelu | from onnx.reference.ops._op import OpRunUnaryNum
class LeakyRelu(OpRunUnaryNum):
def _run(self, x, alpha=None):
alpha = alpha or self.alpha
return (_leaky_relu(x, alpha).astype(x.dtype),) |
class LeakyRelu(OpRunUnaryNum):
def _run(self, x, alpha=None):
pass | 2 | 0 | 3 | 0 | 3 | 2 | 1 | 0.5 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 4 | 0 | 4 | 2 | 2 | 2 | 4 | 2 | 2 | 1 | 7 | 0 | 1 |
16,067 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_less.py | onnx.reference.ops.op_less.Less | from onnx.reference.ops._op import OpRunBinaryComparison
import numpy as np
class Less(OpRunBinaryComparison):
def _run(self, a, b):
return (np.less(a, b),) |
class Less(OpRunBinaryComparison):
def _run(self, a, b):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,068 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_less_or_equal.py | onnx.reference.ops.op_less_or_equal.LessOrEqual | import numpy as np
from onnx.reference.ops._op import OpRunBinaryComparison
class LessOrEqual(OpRunBinaryComparison):
def _run(self, a, b):
return (np.less_equal(a, b),) |
class LessOrEqual(OpRunBinaryComparison):
def _run(self, a, b):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,069 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_log.py | onnx.reference.ops.op_log.Log | from onnx.reference.ops._op import OpRunUnaryNum
import numpy as np
class Log(OpRunUnaryNum):
def _run(self, x):
return (np.log(x).astype(x.dtype),) |
class Log(OpRunUnaryNum):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,070 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_log_softmax.py | onnx.reference.ops.op_log_softmax.LogSoftmax | from onnx.reference.ops.op_softmax import Softmax
import numpy as np
class LogSoftmax(Softmax):
def _run(self, X):
Y = Softmax._run(self, X)[0]
np.log(Y, out=Y)
return (Y,) |
class LogSoftmax(Softmax):
def _run(self, X):
pass | 2 | 0 | 4 | 0 | 4 | 1 | 1 | 0.2 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 43 | 5 | 0 | 5 | 3 | 3 | 1 | 5 | 3 | 3 | 1 | 8 | 0 | 1 |
16,071 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_loop.py | onnx.reference.ops.op_loop.Loop | from onnx.reference.op_run import OpRun
import numpy as np
class Loop(OpRun):
def __init__(self, onnx_node, run_params):
OpRun.__init__(self, onnx_node, run_params)
if 'opsets' not in self.run_params:
raise KeyError("run_params must contains key 'opsets'.")
if 'verbose' not in ... |
class Loop(OpRun):
def __init__(self, onnx_node, run_params):
pass
def need_context(self) -> bool:
'''The operator Loop needs to know all results produced
so far as the loop may silently access one of them.
Some information are not always referred in the list of inputs
... | 4 | 1 | 24 | 1 | 22 | 5 | 7 | 0.22 | 1 | 8 | 0 | 0 | 3 | 3 | 3 | 42 | 76 | 4 | 67 | 22 | 63 | 15 | 61 | 22 | 57 | 18 | 5 | 3 | 22 |
16,072 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_lp_normalization.py | onnx.reference.ops.op_lp_normalization.LpNormalization | from onnx.reference.ops._op import OpRunUnaryNum
import numpy as np
class LpNormalization(OpRunUnaryNum):
def _run(self, x, axis=None, p=None):
axis = axis or self.axis
p = p or self.p
norm = np.power(np.power(x, p).sum(axis=axis), 1.0 / p)
norm = np.expand_dims(norm, axis)
... |
class LpNormalization(OpRunUnaryNum):
def _run(self, x, axis=None, p=None):
pass | 2 | 0 | 6 | 0 | 6 | 5 | 1 | 0.71 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 7 | 0 | 7 | 3 | 5 | 5 | 7 | 3 | 5 | 1 | 7 | 0 | 1 |
16,073 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_lp_pool.py | onnx.reference.ops.op_lp_pool.LpPool | from onnx.reference.ops.op_pool_common import CommonPool
import numpy as np
class LpPool(CommonPool):
def _run(self, x, auto_pad=None, ceil_mode=None, dilations=None, kernel_shape=None, p=2, pads=None, strides=None, count_include_pad=None):
power_average = CommonPool._run(self, 'AVG', count_include_pad, n... |
class LpPool(CommonPool):
def _run(self, x, auto_pad=None, ceil_mode=None, dilations=None, kernel_shape=None, p=2, pads=None, strides=None, count_include_pad=None):
pass | 2 | 0 | 32 | 1 | 28 | 4 | 1 | 0.14 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 33 | 1 | 29 | 15 | 16 | 4 | 5 | 4 | 3 | 1 | 6 | 0 | 1 |
16,074 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_lrn.py | onnx.reference.ops.op_lrn.LRN | import numpy as np
import math
from onnx.reference.op_run import OpRun
class LRN(OpRun):
def _run(self, x, alpha=None, beta=None, bias=None, size=None):
if len(x.shape) != 4:
raise RuntimeError(f'LRN only applies on 4D tensors but shape is {x.shape!r}.')
square_sum = np.zeros(x.shape).... |
class LRN(OpRun):
def _run(self, x, alpha=None, beta=None, bias=None, size=None):
pass | 2 | 0 | 15 | 0 | 15 | 1 | 3 | 0.06 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 40 | 16 | 0 | 16 | 10 | 14 | 1 | 14 | 10 | 12 | 3 | 5 | 1 | 3 |
16,075 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_lstm.py | onnx.reference.ops.op_lstm.CommonLSTM | from onnx.reference.op_run import OpRun
import numpy as np
class CommonLSTM(OpRun):
def __init__(self, onnx_node, run_params):
OpRun.__init__(self, onnx_node, run_params)
self.n_outputs = len(onnx_node.output)
self.n_gates = 3
def f(self, x: np.ndarray) -> np.ndarray:
return 1... |
class CommonLSTM(OpRun):
def __init__(self, onnx_node, run_params):
pass
def f(self, x: np.ndarray) -> np.ndarray:
pass
def g(self, x: np.ndarray) -> np.ndarray:
pass
def h(self, x: np.ndarray) -> np.ndarray:
pass
def _step(self, X: np.ndarray, R: np.ndarray, B:... | 7 | 0 | 22 | 2 | 21 | 3 | 4 | 0.12 | 1 | 3 | 0 | 1 | 6 | 2 | 6 | 45 | 140 | 15 | 124 | 56 | 89 | 15 | 73 | 28 | 66 | 13 | 5 | 2 | 21 |
16,076 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_lstm.py | onnx.reference.ops.op_lstm.LSTM | class LSTM(CommonLSTM):
def __init__(self, onnx_node, run_params):
CommonLSTM.__init__(self, onnx_node, run_params) | class LSTM(CommonLSTM):
def __init__(self, onnx_node, run_params):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 46 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,077 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_matmul.py | onnx.reference.ops.op_matmul.MatMul | from onnx.reference.ops._op import OpRunBinaryNum
class MatMul(OpRunBinaryNum):
def _run(self, a, b):
return (numpy_matmul(a, b),) |
class MatMul(OpRunBinaryNum):
def _run(self, a, b):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,078 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_matmul_integer.py | onnx.reference.ops.op_matmul_integer.MatMulInteger | import numpy as np
from onnx.reference.op_run import OpRun
class MatMulInteger(OpRun):
def _run(self, A, B, a_zero_point=None, b_zero_point=None):
A32 = A.astype(np.int32)
if a_zero_point is not None:
A32 -= a_zero_point
B32 = B.astype(np.int32)
if b_zero_point is not N... |
class MatMulInteger(OpRun):
def _run(self, A, B, a_zero_point=None, b_zero_point=None):
pass | 2 | 0 | 8 | 0 | 8 | 1 | 3 | 0.11 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 9 | 0 | 9 | 4 | 7 | 1 | 9 | 4 | 7 | 3 | 5 | 1 | 3 |
16,079 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_max.py | onnx.reference.ops.op_max.Max | import numpy as np
from onnx.reference.ops._op import OpRunBinaryNumpy
class Max(OpRunBinaryNumpy):
def __init__(self, onnx_node, run_params):
OpRunBinaryNumpy.__init__(self, np.maximum, onnx_node, run_params)
def run(self, *data):
if len(data) == 2:
return OpRunBinaryNumpy.run(se... |
class Max(OpRunBinaryNumpy):
def __init__(self, onnx_node, run_params):
pass
def run(self, *data):
pass | 3 | 0 | 7 | 0 | 7 | 1 | 3 | 0.14 | 1 | 2 | 0 | 0 | 2 | 0 | 2 | 45 | 15 | 1 | 14 | 5 | 11 | 2 | 14 | 5 | 11 | 5 | 8 | 2 | 6 |
16,080 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_max_pool.py | onnx.reference.ops.op_max_pool.MaxPool | import numpy as np
from onnx.reference.ops._op_common_pool import CommonPool
class MaxPool(CommonPool):
def _run(self, x, auto_pad=None, ceil_mode=None, dilations=None, kernel_shape=None, pads=None, storage_order=None, strides=None):
if dilations is not None and (min(dilations) != max(dilations) or min(di... |
class MaxPool(CommonPool):
def _run(self, x, auto_pad=None, ceil_mode=None, dilations=None, kernel_shape=None, pads=None, storage_order=None, strides=None):
pass
def _max_pool(self, x, auto_pad, ceil_mode, dilations, kernel_shape, pads, storage_order, strides):
pass
def _max_pool_1d(self... | 9 | 0 | 63 | 3 | 59 | 3 | 8 | 0.05 | 1 | 4 | 0 | 0 | 5 | 0 | 5 | 45 | 403 | 29 | 373 | 177 | 311 | 19 | 202 | 123 | 193 | 16 | 6 | 7 | 67 |
16,081 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_max_unpool.py | onnx.reference.ops.op_max_unpool.MaxUnpool | from onnx.reference.op_run import OpRun
import numpy as np
class MaxUnpool(OpRun):
def _run(self, X, indices, output_shape=None, kernel_shape=None, pads=None, strides=None):
pooling_dims = len(X.shape) - 2
if pooling_dims > 3:
raise NotImplementedError(f'Unsupported pooling size {pooli... |
class MaxUnpool(OpRun):
def _run(self, X, indices, output_shape=None, kernel_shape=None, pads=None, strides=None):
pass | 2 | 0 | 47 | 8 | 39 | 4 | 7 | 0.1 | 1 | 4 | 0 | 0 | 1 | 0 | 1 | 40 | 48 | 8 | 40 | 16 | 36 | 4 | 31 | 13 | 29 | 7 | 5 | 1 | 7 |
16,082 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_mean.py | onnx.reference.ops.op_mean.Mean | from onnx.reference.op_run import OpRun
class Mean(OpRun):
def _run(self, *args):
res = args[0].copy()
for m in args[1:]:
res += m
return ((res / len(args)).astype(args[0].dtype),) |
class Mean(OpRun):
def _run(self, *args):
pass | 2 | 0 | 5 | 0 | 5 | 1 | 2 | 0.17 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 6 | 0 | 6 | 4 | 4 | 1 | 6 | 4 | 4 | 2 | 5 | 1 | 2 |
16,083 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_mel_weight_matrix.py | onnx.reference.ops.op_mel_weight_matrix.MelWeightMatrix | from onnx.helper import tensor_dtype_to_np_dtype
from onnx.reference.op_run import OpRun
import numpy as np
class MelWeightMatrix(OpRun):
def _run(self, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz, output_datatype=None):
num_spectrogram_bins = dft_length // 2 + 1
freq... |
class MelWeightMatrix(OpRun):
def _run(self, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz, output_datatype=None):
pass | 2 | 0 | 49 | 5 | 44 | 4 | 7 | 0.09 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 40 | 50 | 5 | 45 | 24 | 35 | 4 | 31 | 16 | 29 | 7 | 5 | 3 | 7 |
16,084 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_min.py | onnx.reference.ops.op_min.Min | import numpy as np
from onnx.reference.ops._op import OpRunBinaryNumpy
class Min(OpRunBinaryNumpy):
def __init__(self, onnx_node, run_params):
OpRunBinaryNumpy.__init__(self, np.minimum, onnx_node, run_params)
def run(self, *data):
if len(data) == 2:
return OpRunBinaryNumpy.run(se... |
class Min(OpRunBinaryNumpy):
def __init__(self, onnx_node, run_params):
pass
def run(self, *data):
pass | 3 | 0 | 7 | 0 | 7 | 1 | 3 | 0.14 | 1 | 2 | 0 | 0 | 2 | 0 | 2 | 45 | 15 | 1 | 14 | 5 | 11 | 2 | 14 | 5 | 11 | 5 | 8 | 2 | 6 |
16,085 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_mod.py | onnx.reference.ops.op_mod.Mod | import numpy as np
from onnx.reference.op_run import OpRun
class Mod(OpRun):
def _run(self, a, b, fmod=None):
fmod = fmod or self.fmod
if fmod == 1:
return (np.fmod(a, b),)
if a.dtype in (np.float16, np.float32, np.float64):
return (np.nan_to_num(np.fmod(a, b)),)
... |
class Mod(OpRun):
def _run(self, a, b, fmod=None):
pass | 2 | 0 | 7 | 0 | 7 | 3 | 3 | 0.38 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 8 | 0 | 8 | 2 | 6 | 3 | 8 | 2 | 6 | 3 | 5 | 1 | 3 |
16,086 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_mul.py | onnx.reference.ops.op_mul.Mul | from onnx.reference.ops._op import OpRunBinaryNumpy
import numpy as np
class Mul(OpRunBinaryNumpy):
def __init__(self, onnx_node, run_params):
OpRunBinaryNumpy.__init__(self, np.multiply, onnx_node, run_params) |
class Mul(OpRunBinaryNumpy):
def __init__(self, onnx_node, run_params):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 44 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 8 | 0 | 1 |
16,087 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_neg.py | onnx.reference.ops.op_neg.Neg | import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class Neg(OpRunUnaryNum):
def _run(self, x):
return (np.negative(x),) |
class Neg(OpRunUnaryNum):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 42 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
16,088 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_negative_log_likelihood_loss.py | onnx.reference.ops.op_negative_log_likelihood_loss.NegativeLogLikelihoodLoss | from onnx.reference.op_run import OpRun
class NegativeLogLikelihoodLoss(OpRun):
def _run(self, x, target, weight=None, ignore_index=None, reduction=None):
return _compute_negative_log_likelihood_loss(x, target, weight=weight, reduction=reduction, ignore_index=ignore_index) |
class NegativeLogLikelihoodLoss(OpRun):
def _run(self, x, target, weight=None, ignore_index=None, reduction=None):
pass | 2 | 0 | 8 | 0 | 8 | 1 | 1 | 0.11 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 9 | 0 | 9 | 2 | 7 | 1 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,089 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_non_max_suppression.py | onnx.reference.ops.op_non_max_suppression.BoxInfo | class BoxInfo:
def __init__(self, score: float=0, idx: int=-1):
self.score_ = score
self.idx_ = idx
def __lt__(self, rhs) -> bool:
return self.score_ < rhs.score_ or (self.score_ == rhs.score_ and self.idx_ > rhs.idx_)
def __repr__(self) -> str:
return f'BoxInfo({self.scor... | class BoxInfo:
def __init__(self, score: float=0, idx: int=-1):
pass
def __lt__(self, rhs) -> bool:
pass
def __repr__(self) -> str:
pass | 4 | 0 | 3 | 0 | 3 | 1 | 1 | 0.2 | 0 | 4 | 0 | 0 | 3 | 2 | 3 | 3 | 12 | 2 | 10 | 6 | 6 | 2 | 8 | 6 | 4 | 1 | 0 | 0 | 3 |
16,090 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_non_max_suppression.py | onnx.reference.ops.op_non_max_suppression.NonMaxSuppression | from onnx.reference.op_run import OpRun
import numpy as np
class NonMaxSuppression(OpRun):
def get_thresholds_from_inputs(self, pc: PrepareContext, max_output_boxes_per_class: int, iou_threshold: float, score_threshold: float) -> tuple[int, float, float]:
if pc.max_output_boxes_per_class_ is not None:
... |
class NonMaxSuppression(OpRun):
def get_thresholds_from_inputs(self, pc: PrepareContext, max_output_boxes_per_class: int, iou_threshold: float, score_threshold: float) -> tuple[int, float, float]:
pass
def prepare_compute(self, pc: PrepareContext, boxes_tensor: np.ndarray, scores_tensor: np.ndarray, ... | 4 | 0 | 47 | 6 | 38 | 7 | 7 | 0.18 | 1 | 7 | 3 | 0 | 3 | 0 | 3 | 42 | 144 | 21 | 114 | 46 | 88 | 21 | 65 | 24 | 61 | 13 | 5 | 5 | 21 |
16,091 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_non_max_suppression.py | onnx.reference.ops.op_non_max_suppression.PrepareContext | import numpy as np
import dataclasses
@dataclasses.dataclass
class PrepareContext:
boxes_data_: np.ndarray | None = None
boxes_size_: int = 0
scores_data_: np.ndarray | None = None
scores_size_: int = 0
max_output_boxes_per_class_: np.ndarray | None = None
score_threshold_: np.ndarray | None = ... | @dataclasses.dataclass
class PrepareContext:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 | 11 | 11 | 10 | 0 | 11 | 11 | 10 | 0 | 0 | 0 | 0 |
16,092 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_non_max_suppression.py | onnx.reference.ops.op_non_max_suppression.SelectedIndex | class SelectedIndex:
__slots__ = ('batch_index_', 'box_index_', 'class_index_')
def __init__(self, batch_index: int=0, class_index: int=0, box_index: int=0) -> None:
self.batch_index_ = batch_index
self.class_index_ = class_index
self.box_index_ = box_index | class SelectedIndex:
def __init__(self, batch_index: int=0, class_index: int=0, box_index: int=0) -> None:
pass | 2 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 3 | 1 | 1 | 9 | 1 | 8 | 8 | 4 | 0 | 6 | 6 | 4 | 1 | 0 | 0 | 1 |
16,093 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_non_zero.py | onnx.reference.ops.op_non_zero.NonZero | from onnx.reference.op_run import OpRun
import numpy as np
class NonZero(OpRun):
def _run(self, x):
res = np.vstack(np.nonzero(x)).astype(np.int64)
return (res,) |
class NonZero(OpRun):
def _run(self, x):
pass | 2 | 0 | 4 | 0 | 3 | 2 | 1 | 0.5 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 5 | 0 | 4 | 3 | 2 | 2 | 4 | 3 | 2 | 1 | 5 | 0 | 1 |
16,094 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_not.py | onnx.reference.ops.op_not.Not | from onnx.reference.ops._op import OpRunUnary
import numpy as np
class Not(OpRunUnary):
def _run(self, x):
return (np.logical_not(x),) |
class Not(OpRunUnary):
def _run(self, x):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
16,095 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_one_hot.py | onnx.reference.ops.op_one_hot.OneHot | from onnx.reference.op_run import OpRun
class OneHot(OpRun):
def _run(self, indices, depth, values, axis=None):
off_value, on_value = values
y = _one_hot(indices, depth, axis=axis, dtype=values.dtype)
y = y * (on_value - off_value) + off_value
return (y,) |
class OneHot(OpRun):
def _run(self, indices, depth, values, axis=None):
pass | 2 | 0 | 5 | 0 | 5 | 2 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 6 | 0 | 6 | 4 | 4 | 2 | 6 | 4 | 4 | 1 | 5 | 0 | 1 |
16,096 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_optional.py | onnx.reference.ops.op_optional.Optional | from onnx.reference.op_run import OpRun
from onnx.helper import tensor_dtype_to_np_dtype
class Optional(OpRun):
def _run(self, x=None, type=None):
if x is not None and type is not None:
dt = tensor_dtype_to_np_dtype(type)
if dt != x.dtype:
raise TypeError(f'Input dt... |
class Optional(OpRun):
def _run(self, x=None, type=None):
pass | 2 | 0 | 8 | 0 | 8 | 1 | 3 | 0.11 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 9 | 0 | 9 | 3 | 7 | 1 | 7 | 3 | 5 | 3 | 5 | 2 | 3 |
16,097 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_optional_get_element.py | onnx.reference.ops.op_optional_get_element.OptionalGetElement | from onnx.reference.op_run import OpRun
class OptionalGetElement(OpRun):
def _run(self, x):
if x is None:
raise ValueError('The requested optional input has no value.')
return (x,) |
class OptionalGetElement(OpRun):
def _run(self, x):
pass | 2 | 0 | 4 | 0 | 4 | 1 | 2 | 0.2 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 40 | 5 | 0 | 5 | 2 | 3 | 1 | 5 | 2 | 3 | 2 | 5 | 1 | 2 |
16,098 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_optional_has_element.py | onnx.reference.ops.op_optional_has_element.OptionalHasElement | from onnx.reference.op_run import OpRun
import numpy as np
class OptionalHasElement(OpRun):
def _run(self, x=None):
return (np.array(x is not None),) |
class OptionalHasElement(OpRun):
def _run(self, x=None):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 40 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
16,099 | onnx/onnx | onnx_onnx/onnx/reference/ops/op_or.py | onnx.reference.ops.op_or.Or | import numpy as np
from onnx.reference.ops._op import OpRunBinary
class Or(OpRunBinary):
def _run(self, x, y):
return (np.logical_or(x, y),) |
class Or(OpRunBinary):
def _run(self, x, y):
pass | 2 | 0 | 2 | 0 | 2 | 1 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 41 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.