repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
onnx | onnx/backend/test/case/node/bitwiseand.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.numpy_helper import create_random_int
class BitwiseAnd(Base):
... | 56 | 1,673 |
onnx | onnx/backend/test/case/node/argmax.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def argmax_use_numpy(data: np.ndarray, axis: int = 0, keepdims: int = 1) -> ... | 257 | 8,360 |
onnx | onnx/backend/test/case/node/thresholdedrelu.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class ThresholdedRelu(Base):
@staticmethod
def export() -> None:
... | 42 | 1,298 |
onnx | onnx/backend/test/case/node/optionalhaselement.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def optional_has_element_reference_implementation(
optional: np.ndarray ... | 94 | 3,381 |
onnx | onnx/backend/test/case/node/less_equal.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Less(Base):
@staticmethod
def export() -> None:
node =... | 69 | 2,508 |
onnx | onnx/backend/test/case/node/reduce_log_sum.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class ReduceLogSum(Base):
@staticmethod
def export_nokeepdims() -> N... | 105 | 3,091 |
onnx | onnx/backend/test/case/node/qlinearconv.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class QLinearConv(Base):
@staticmethod
def export() -> None:
... | 83 | 2,295 |
onnx | onnx/backend/test/case/node/softmax.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def softmax(x: np.ndarray, axis: int = -1) -> np.ndarray:
x_max = np.max... | 92 | 2,686 |
onnx | onnx/backend/test/case/node/meanvariancenormalization.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class MeanVarianceNormalization(Base):
@staticmethod
def export() ->... | 50 | 1,722 |
onnx | onnx/backend/test/case/node/averagepool.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.reference.ops.op_pool_common import (
get_output_shape_auto_pad,... | 696 | 21,173 |
onnx | onnx/backend/test/case/node/dropout.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx import helper
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def dropout(X, drop_probability=0.5, seed=0, trainin... | 210 | 6,341 |
onnx | onnx/backend/test/case/node/attention.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.reference.ops.op_attention import _compute_attention
class Attenti... | 2,700 | 95,721 |
onnx | onnx/backend/test/case/node/gelu.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import math
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Gelu(Base):
@staticmethod
def export_gelu_tanh() ... | 53 | 1,806 |
onnx | onnx/backend/test/case/node/gru.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import Any
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class GRUHelper:
def __init__(self, **params: An... | 384 | 11,438 |
onnx | onnx/backend/test/case/node/pow.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def pow(x: np.ndarray, y: np.ndarray) -> np.ndarray: # noqa: A001
retur... | 107 | 3,900 |
onnx | onnx/backend/test/case/node/compress.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Compress(Base):
@staticmethod
def export_compress_0() -> None:... | 100 | 2,746 |
onnx | onnx/backend/test/case/node/gemm.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def gemm_reference_implementation(
A: np.ndarray,
B: np.ndarray,
... | 158 | 5,938 |
onnx | onnx/backend/test/case/node/hammingwindow.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class HammingWindow(Base):
@staticmethod
def export() -> None:
... | 49 | 1,288 |
onnx | onnx/backend/test/case/node/optionalgetelement.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import Any
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def optional_get_element_reference_implementation(op... | 81 | 2,546 |
onnx | onnx/backend/test/case/node/rnn.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import Any
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class RNNHelper:
def __init__(self, **params: An... | 327 | 9,587 |
onnx | onnx/backend/test/case/node/quantizelinear.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx import TensorProto
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.helper import make_tensor
class Quant... | 500 | 13,752 |
onnx | onnx/backend/test/case/node/qlinearmatmul.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class QLinearMatMul(Base):
@staticmethod
def export_int() -> None:
... | 152 | 5,272 |
onnx | onnx/backend/test/case/node/argmin.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def argmin_use_numpy(data: np.ndarray, axis: int = 0, keepdims: int = 1) -> ... | 257 | 8,442 |
onnx | onnx/backend/test/case/node/cast.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import itertools
import numpy as np
import onnx
from onnx import TensorProto
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.helper import (
m... | 399 | 13,573 |
onnx | onnx/backend/test/case/node/flatten.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Flatten(Base):
@staticmethod
def export() -> None:
sha... | 66 | 1,932 |
onnx | onnx/backend/test/case/node/bitwisexor.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.numpy_helper import create_random_int
class BitwiseXor(Base):
... | 56 | 1,672 |
onnx | onnx/backend/test/case/node/atan.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Atan(Base):
@staticmethod
def export() -> None:
node =... | 29 | 723 |
onnx | onnx/backend/test/case/node/einsum.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def einsum_reference_implementation(
Eqn: str, Operands: tuple[np.ndarra... | 93 | 2,693 |
onnx | onnx/backend/test/case/node/scan.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
import onnx.parser
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Scan(Base):
@staticmethod
def export_scan_8... | 156 | 5,879 |
onnx | onnx/backend/test/case/node/slice.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Slice(Base):
@staticmethod
def export_slice() -> None:
... | 179 | 5,270 |
onnx | onnx/backend/test/case/node/__init__.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import sys
from copy import deepcopy
from typing import TYPE_CHECKING, Any
import onnx
from onnx.backend.test.case.test_case import TestCase
from onnx.backend.test.case.utils import import_recursive
fr... | 412 | 16,598 |
onnx | onnx/backend/test/case/node/mul.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Mul(Base):
@staticmethod
def export() -> None:
node = ... | 74 | 2,575 |
onnx | onnx/backend/test/case/node/cumsum.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class CumSum(Base):
@staticmethod
def export_cumsum_1d() -> None:
... | 113 | 4,319 |
onnx | onnx/backend/test/case/node/neg.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Neg(Base):
@staticmethod
def export() -> None:
node = ... | 29 | 750 |
onnx | onnx/backend/test/case/node/hardsigmoid.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class HardSigmoid(Base):
@staticmethod
def export() -> None:
... | 40 | 1,256 |
onnx | onnx/backend/test/case/node/affinegrid.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.reference.ops.op_affine_grid import (
apply_affine_transform,
... | 209 | 6,084 |
onnx | onnx/backend/test/case/node/bernoulli.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def bernoulli_reference_implementation(x, dtype):
# binomial n = 1 equal... | 60 | 1,870 |
onnx | onnx/backend/test/case/node/acos.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Acos(Base):
@staticmethod
def export() -> None:
node =... | 29 | 726 |
onnx | onnx/backend/test/case/node/asinh.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Asinh(Base):
@staticmethod
def export() -> None:
node ... | 29 | 780 |
onnx | onnx/backend/test/case/node/hardmax.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def hardmax(x: np.ndarray, axis: int = -1) -> np.ndarray:
x_argmax = np.... | 93 | 2,659 |
onnx | onnx/backend/test/case/node/batchnorm.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def _batchnorm_test_mode(x, s, bias, mean, var, epsilon=1e-5):
dims_x = ... | 138 | 4,732 |
onnx | onnx/backend/test/case/node/reducemean.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class ReduceMean(Base):
@staticmethod
def export_do_not_keepdims() -... | 175 | 4,806 |
onnx | onnx/backend/test/case/node/roialign.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def get_roi_align_input_values():
X = np.array(
[
[
... | 447 | 14,904 |
onnx | onnx/backend/test/case/node/reducesum.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class ReduceSum(Base):
@staticmethod
def export_do_not_keepdims() ->... | 248 | 7,155 |
onnx | onnx/backend/test/case/node/dequantizelinear.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx import TensorProto
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.helper import make_tensor
class Dequa... | 374 | 11,175 |
onnx | onnx/backend/test/case/node/sqrt.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Sqrt(Base):
@staticmethod
def export() -> None:
node =... | 29 | 758 |
onnx | onnx/backend/test/case/node/sum.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Sum(Base):
@staticmethod
def export() -> None:
data_0 ... | 48 | 1,345 |
onnx | onnx/backend/test/case/node/cumprod.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class CumProd(Base):
@staticmethod
def export_cumprod_1d() -> None:
... | 130 | 4,714 |
onnx | onnx/backend/test/case/node/image_decoder.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import io
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import _image_decoder_data, expect
def generate_checkerboard(width: int, height... | 250 | 7,381 |
onnx | onnx/backend/test/case/node/greater.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Greater(Base):
@staticmethod
def export() -> None:
nod... | 69 | 2,452 |
onnx | onnx/backend/test/case/node/stringnormalizer.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class StringNormalizer(Base):
@staticmethod
def export_nostopwords_n... | 149 | 4,428 |
onnx | onnx/backend/test/case/node/_image_decoder_data.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
# This file contains freeze NumPy array for ImageDecoder backend test's input/output
# They were generated by image_decoder.py's generate_test_data with pillow
# To make ONNX backend test generation simple, use freeze NumPy array directl... | 6,354 | 210,448 |
onnx | onnx/backend/test/case/node/sigmoid.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Sigmoid(Base):
@staticmethod
def export() -> None:
nod... | 31 | 853 |
onnx | onnx/backend/test/case/node/deformconv.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class DeformConv(Base):
@staticmethod
def export() -> None:
... | 162 | 5,368 |
onnx | onnx/backend/test/case/node/sequence_map.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class SequenceMap(Base):
@staticmethod
def export_sequence_map_ident... | 305 | 10,952 |
onnx | onnx/backend/test/case/node/size.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Size(Base):
@staticmethod
def export() -> None:
node =... | 36 | 843 |
onnx | onnx/backend/test/case/node/groupnormalization.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
# Group normalization's reference implementation
def _group_normalization(x,... | 79 | 2,498 |
onnx | onnx/backend/test/case/node/where.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Where(Base):
@staticmethod
def export() -> None:
node ... | 43 | 1,330 |
onnx | onnx/backend/test/case/node/reducel2.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class ReduceL2(Base):
@staticmethod
def export_do_not_keepdims() -> ... | 208 | 6,012 |
onnx | onnx/backend/test/case/node/conv.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Conv(Base):
@staticmethod
def export() -> None:
x = np... | 258 | 8,173 |
onnx | onnx/backend/test/case/node/unsqueeze.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Unsqueeze(Base):
@staticmethod
def export_unsqueeze_one_axis()... | 92 | 2,767 |
onnx | onnx/backend/test/case/node/blackmanwindow.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class BlackmanWindow(Base):
@staticmethod
def export() -> None:
... | 57 | 1,539 |
onnx | onnx/backend/test/case/node/relu.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Relu(Base):
@staticmethod
def export() -> None:
node =... | 25 | 582 |
onnx | onnx/backend/test/case/node/gather.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Gather(Base):
@staticmethod
def export_gather_0() -> None:
... | 92 | 2,378 |
onnx | onnx/backend/test/case/node/sign.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Sign(Base):
@staticmethod
def export() -> None:
node =... | 25 | 569 |
onnx | onnx/backend/test/case/node/tile.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Tile(Base):
@staticmethod
def export_tile() -> None:
n... | 39 | 1,103 |
onnx | onnx/backend/test/case/node/convinteger.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class ConvInteger(Base):
@staticmethod
def export_without_padding() ... | 104 | 2,747 |
onnx | onnx/backend/test/case/node/swiglu.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def swiglu(a: np.ndarray, b: np.ndarray, alpha: float) -> np.ndarray:
sw... | 81 | 2,292 |
onnx | onnx/backend/test/case/node/expand.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Expand(Base):
@staticmethod
def export_dim_changed() -> None:
... | 67 | 1,947 |
onnx | onnx/backend/test/case/node/greater_equal.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Greater(Base):
@staticmethod
def export() -> None:
nod... | 69 | 2,574 |
onnx | onnx/backend/test/case/node/prelu.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class PRelu(Base):
@staticmethod
def export() -> None:
node ... | 41 | 1,156 |
onnx | onnx/backend/test/case/node/topk.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def topk_sorted_implementation(X, k, axis, largest):
ind_axis = np.indic... | 263 | 6,761 |
onnx | onnx/backend/test/case/node/rangeop.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import ml_dtypes
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Range(Base):
@staticmethod
def export_range_f... | 103 | 2,828 |
onnx | onnx/backend/test/case/node/softmaxcrossentropy.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import Any
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def softmaxcrossentropy(
x: np.ndarray,
targ... | 1,159 | 35,653 |
onnx | onnx/backend/test/case/node/trilu.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def triu_reference_implementation(x, k=0):
return np.triu(x, k)
def tr... | 454 | 12,514 |
onnx | onnx/backend/test/case/node/if_.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def compute_if_outputs(x, cond):
if cond:
return []
return x... | 211 | 6,475 |
onnx | onnx/backend/test/case/node/bitwisenot.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.numpy_helper import create_random_int
class BitwiseNot(Base):
... | 37 | 1,005 |
onnx | onnx/backend/test/case/node/softsign.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Softsign(Base):
@staticmethod
def export() -> None:
no... | 29 | 777 |
onnx | onnx/backend/test/case/node/identity.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Identity(Base):
@staticmethod
def export() -> None:
no... | 94 | 2,369 |
onnx | onnx/backend/test/case/node/rotaryembedding.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.reference.ops.op_rotary_embedding import rotary_embedding
class Ro... | 232 | 7,829 |
onnx | onnx/backend/test/case/node/gridsample.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class GridSample(Base):
@staticmethod
def export_gridsample() -> Non... | 643 | 19,717 |
onnx | onnx/backend/test/case/node/nonmaxsuppression.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class NonMaxSuppression(Base):
@staticmethod
def export_nonmaxsuppre... | 476 | 16,032 |
onnx | onnx/backend/test/case/node/matmul.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class MatMul(Base):
@staticmethod
def export() -> None:
node... | 63 | 2,040 |
onnx | onnx/backend/test/case/node/pad.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def pad_impl(data, raw_pads, mode, constant_values=0.0, axes=None):
inpu... | 130 | 3,971 |
onnx | onnx/backend/test/case/node/flexattention.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx import TensorProto, helper
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.defs import AI_ONNX_PREVIEW_DOM... | 584 | 20,278 |
onnx | onnx/backend/test/case/node/add.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Add(Base):
@staticmethod
def export() -> None:
node = ... | 61 | 2,244 |
onnx | onnx/backend/test/case/node/reciprocal.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Reciprocal(Base):
@staticmethod
def export() -> None:
... | 29 | 790 |
onnx | onnx/backend/test/case/node/isnan.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class IsNaN(Base):
@staticmethod
def export() -> None:
node ... | 37 | 962 |
onnx | onnx/backend/test/case/node/loop.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import Any
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def compute_loop_outputs(x, seq, trip_count):
fo... | 460 | 14,731 |
onnx | onnx/backend/test/case/node/adagrad.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.defs import AI_ONNX_PREVIEW_TRAINING_DOMAIN
def apply_adagrad(r, t... | 117 | 3,747 |
onnx | onnx/backend/test/case/node/tensorscatter.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class TensorScatter(Base):
@staticmethod
def export_tensorscatter() ... | 175 | 5,207 |
onnx | onnx/backend/test/case/node/string_split.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class StringSplit(Base):
@staticmethod
def export_basic() -> None:
... | 152 | 4,128 |
onnx | onnx/backend/test/case/node/concat.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import TYPE_CHECKING, Any
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
if TYPE_CHECKING:
from collections... | 57 | 1,928 |
onnx | onnx/backend/test/case/node/reduceprod.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class ReduceProd(Base):
@staticmethod
def export_do_not_keepdims() -... | 188 | 5,303 |
onnx | onnx/backend/test/case/node/log.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Log(Base):
@staticmethod
def export() -> None:
node = ... | 29 | 754 |
onnx | onnx/backend/test/case/node/reducesumsquare.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class ReduceSumSquare(Base):
@staticmethod
def export_do_not_keepdim... | 195 | 5,558 |
onnx | onnx/backend/test/case/node/stft.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class STFT(Base):
@staticmethod
def export() -> None:
signal... | 71 | 2,400 |
onnx | onnx/backend/test/case/node/maxunpool.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class MaxUnpool(Base):
@staticmethod
def export_without_output_shape... | 68 | 1,954 |
onnx | onnx/backend/test/case/node/melweightmatrix.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class MelWeightMatrix(Base):
@staticmethod
def export() -> None:
... | 91 | 3,700 |
onnx | onnx/backend/test/case/node/sinh.py | .py | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Sinh(Base):
@staticmethod
def export() -> None:
node =... | 29 | 770 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.