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 |
|---|---|---|---|---|---|
openvino | tests/layer_tests/pytorch_tests/test_trilu.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestTriuTril(PytorchLayerTest):
def _prepare_input(self, shape, dtype):
return (self.random.randn(*shape, dtype=dtype),)
def create_model(self,... | 92 | 2,969 |
openvino | tests/layer_tests/pytorch_tests/test_reshape.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import random
import numpy as np
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestReshape(PytorchLayerTest):
def _prepare_input(self, complex_type):
shape = (1, 12, 12, 24)
if complex_t... | 85 | 2,726 |
openvino | tests/layer_tests/pytorch_tests/test_tuple_construct.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import numpy as np
from pytorch_layer_test_class import PytorchLayerTest
class TestTupleConstruct(PytorchLayerTest):
def _prepare_input(self):
return (self.random.uniform(0, 50, (1, 10), dtype=np.float32),)
... | 232 | 7,630 |
openvino | tests/layer_tests/pytorch_tests/test_narrow.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestNarrow(PytorchLayerTest):
def _prepare_input(self):
return (self.random.randn(*self.input_shape),)
def create_model(self, dim,... | 40 | 1,323 |
openvino | tests/layer_tests/pytorch_tests/test_unary_ops.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
import torch.nn.functional as F
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
OPS = {
"aten::abs": torch.abs,
"aten::abs_": torch.abs_,
"aten::rsqrt": torch.rsqrt,
"ate... | 328 | 12,915 |
openvino | tests/layer_tests/pytorch_tests/test_size.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestSize(PytorchLayerTest):
def _prepare_input(self, input_shape, complex_type):
if complex_type:
input_shape += [2]
return (sel... | 44 | 1,541 |
openvino | tests/layer_tests/pytorch_tests/test_listunpack.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestListUnpack(PytorchLayerTest):
def _prepare_input(self):
return (
self.random.randn(8, 3, 512, 512),... | 348 | 11,201 |
openvino | tests/layer_tests/pytorch_tests/test_distance.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestCdist(PytorchLayerTest):
def _prepare_input(self, x_dtype="float32", y_dtype="float32"):
return (self.random.randint(-10, 10, (... | 70 | 2,546 |
openvino | tests/layer_tests/pytorch_tests/test_broadcast_tensors.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestBroadcastTensors(PytorchLayerTest):
def _prepare_input(self, x_shape, y_shape, z_shape, x_dtype, y_dtype, z_dtype):
return (
self.ra... | 45 | 1,816 |
openvino | tests/layer_tests/pytorch_tests/test_round.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class TestRound(PytorchLayerTest):
def _prepare_input(self, out=False, dtype="float32"):
import numpy as np
input = self.random.ra... | 92 | 3,273 |
openvino | tests/layer_tests/pytorch_tests/test_group_norm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestGroupNorm(PytorchLayerTest):
def _prepare_input(self, ndim=4):
shape5d = [20, 6, 10, 10, 10]
shape = shape5d[:ndim]
return (self... | 58 | 2,438 |
openvino | tests/layer_tests/pytorch_tests/test_svd.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
import openvino as ov
from pytorch_layer_test_class import PytorchLayerTest
class TestSVDReconstruction(PytorchLayerTest):
"""aten::svd — batched 3x3 singular value decomposition.
... | 203 | 9,733 |
openvino | tests/layer_tests/pytorch_tests/test_search_sorted.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
import numpy as np
class TestSearchSorted(PytorchLayerTest):
def _prepare_input(self):
return (np.array(self.sorted).astype(self.sorted_type),np.array(sel... | 47 | 1,957 |
openvino | tests/layer_tests/pytorch_tests/test_norm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import numpy as np
import pytest
import torch
from packaging import version
from pytorch_layer_test_class import PytorchLayerTest
# torch._VF.frobenius_norm is deprecated in PyTorch 2.9 in favour of linalg.vector_norm.... | 470 | 20,062 |
openvino | tests/layer_tests/pytorch_tests/test_index_fill_.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestIndexFill(PytorchLayerTest):
def _prepare_input(self):
return (self.input_tensor,)
def create_model(self, ... | 83 | 2,627 |
openvino | tests/layer_tests/pytorch_tests/test_clamp.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class TestClamp(PytorchLayerTest):
def _prepare_input(self):
return (self.random.randn(1, 3, 224, 224),)
def create_model(self, minim... | 124 | 4,953 |
openvino | tests/layer_tests/pytorch_tests/test_addmm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestAddMM(PytorchLayerTest):
def _prepare_input(self, input_shape=(2, 2), matrix1_shape=(2, 2), matrix2_shape=(2, 2)):
return (
self.ran... | 97 | 3,944 |
openvino | tests/layer_tests/pytorch_tests/test_index_tensor.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestIndexTensor(PytorchLayerTest):
def _prepare_input(self, input_shape):
return (self.random.randn(*input_shape),)
def create_model(self, indi... | 50 | 2,005 |
openvino | tests/layer_tests/pytorch_tests/test_arange.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import numpy as np
from pytorch_layer_test_class import PytorchLayerTest, skip_check, skip_if_export
import torch
class TestArange(PytorchLayerTest):
def _prepare_input(self, start=None, end=None, step=None, ref_valu... | 352 | 16,914 |
openvino | tests/layer_tests/pytorch_tests/test_rrelu.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
import torch.nn.functional as F
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class aten_rrelu(torch.nn.Module):
def __init__(self, lower, upper, dtype, inplace):
super().... | 50 | 1,520 |
openvino | tests/layer_tests/pytorch_tests/test_bernoulli.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestBernoulli(PytorchLayerTest):
def _prepare_input(self, input, input_type, out):
model_inputs = [input.astype(inpu... | 107 | 4,210 |
openvino | tests/layer_tests/pytorch_tests/test_angle.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestAngle(PytorchLayerTest):
def _prepare_input(self, complex_type):
shape = (5, 6, 7)
if complex_type:
shape... | 42 | 1,326 |
openvino | tests/layer_tests/pytorch_tests/test_sub.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestSub(PytorchLayerTest):
def _prepare_input(self):
return self.input_data
def create_model(self, inplace):
class aten_s... | 254 | 10,133 |
openvino | tests/layer_tests/pytorch_tests/test_masked_scatter.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from packaging.version import parse as parse_version
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class TestMaskedScatter(PytorchLayerTest):
def _prepare_input(self, shape, x_dty... | 85 | 4,420 |
openvino | tests/layer_tests/pytorch_tests/test_view.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
@pytest.mark.parametrize('input_shapes',
[
[
[2, 3, 2], np.array(2), np.array(6)
],
[
[4], np.array(2), np... | 193 | 5,299 |
openvino | tests/layer_tests/pytorch_tests/test_select_scatter.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
import torch
class TestSelectScatter(PytorchLayerTest):
def _prepare_input(self):
return (self.random.randn(2, 5, 3, 4),)
def create_model(self, src, ... | 36 | 1,159 |
openvino | tests/layer_tests/pytorch_tests/test_deformable_convolution.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from copy import deepcopy
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
from torchvision.ops import deform_conv2d
params = [
{
"weights_shape": [64, 64, 3, 3],
"offset_shape": [1,... | 181 | 5,329 |
openvino | tests/layer_tests/pytorch_tests/test_mean.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestMean(PytorchLayerTest):
def _prepare_input(self, use_out, keep_dim, axis, dtype):
import numpy as np
if keep_dim is None:
ke... | 103 | 4,538 |
openvino | tests/layer_tests/pytorch_tests/test_floor_divide.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import numpy as np
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestFloorDivide(PytorchLayerTest):
def _prepare_input(self):
return (self.input_tensor, self.other_tensor)
... | 127 | 4,883 |
openvino | tests/layer_tests/pytorch_tests/test_if.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import pytest
import numpy as np
from pytorch_layer_test_class import PytorchLayerTest
class TestIf(PytorchLayerTest):
def _prepare_input(self):
return (self.random.randn(1, 3, 224, 224), self.y)
def create_... | 41 | 1,218 |
openvino | tests/layer_tests/pytorch_tests/test_copy.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class TestCopy(PytorchLayerTest):
def _prepare_input(self):
import numpy as np
return (self.random.randn(1, 3, 224, 224),)
de... | 69 | 2,129 |
openvino | tests/layer_tests/pytorch_tests/test_replication_pad.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestReplicationPad(PytorchLayerTest):
def _prepare_input(self, n):
return (self.random.randn(*(2, 5, 6, 7, 8)[:n+2]),)
def create_model(self, p... | 56 | 1,703 |
openvino | tests/layer_tests/pytorch_tests/test_data.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class Model(torch.nn.Module):
def forward(self, x):
return x.data
class ModelGrad(torch.nn.Module):
def forward(self... | 67 | 2,483 |
openvino | tests/layer_tests/pytorch_tests/test_or.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestOr(PytorchLayerTest):
def _prepare_input(self):
return self.input_data
def create_model_tensor_input(self):... | 84 | 2,868 |
openvino | tests/layer_tests/pytorch_tests/test_index_add.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestIndexAdd(PytorchLayerTest):
def _prepare_input(self, dtype, out):
if not out:
return (np.ones((3, 3))... | 67 | 2,528 |
openvino | tests/layer_tests/pytorch_tests/test_embedding_bag.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestEmbeddingBag1dOffsets(PytorchLayerTest):
def _prepare_input(self, indicies_dtype, per_sample_weights=False):
import numpy as np... | 247 | 8,972 |
openvino | tests/layer_tests/pytorch_tests/test_softmax.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
import torch.nn.functional as F
from pytorch_layer_test_class import PytorchLayerTest
class TestSoftmax(PytorchLayerTest):
def _prepare_input(self, second_input_dtype=None):
if second_input_dtype... | 93 | 3,203 |
openvino | tests/layer_tests/pytorch_tests/test_cumsum.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestCumSum(PytorchLayerTest):
def _prepare_input(self, out=False, out_dtype=None):
x = self.random.randn(1, 3, 224, 224)
if... | 81 | 3,086 |
openvino | tests/layer_tests/pytorch_tests/test_comparision.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestComp(PytorchLayerTest):
def _prepare_input(self):
return (self.random.randn(1, 3, 24, 24), self.random.randn(1, 3, 24, 24))
de... | 136 | 4,932 |
openvino | tests/layer_tests/pytorch_tests/test_empty.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestEmptyNumeric(PytorchLayerTest):
def _prepare_input(self):
return (self.random.randn(10, 10, 10),)
def crea... | 214 | 9,044 |
openvino | tests/layer_tests/pytorch_tests/test_index.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import numpy as np
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestIndex(PytorchLayerTest):
def _prepare_input(self, input_shape, idx=None):
x = self.random.randn(*input_shape)
... | 184 | 6,972 |
openvino | tests/layer_tests/pytorch_tests/test_gelu.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestGelu(PytorchLayerTest):
def _prepare_input(self):
return (self.random.randn(2, 3),)
def create_model(self, approximate):
import tor... | 34 | 1,004 |
openvino | tests/layer_tests/pytorch_tests/test_quantized_add.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class quantized_add(torch.nn.Module):
def __init__(self, scale, zero_point, dtype) -> None:
torch.nn.Modu... | 53 | 1,845 |
openvino | tests/layer_tests/pytorch_tests/test_istft.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestISTFT(PytorchLayerTest):
def _prepare_input(self, n_fft, hop_length, win_length, center, normalized, signal_shape, rand_data=False, out_dty... | 247 | 10,059 |
openvino | tests/layer_tests/pytorch_tests/test_slice.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestSlice1D(PytorchLayerTest):
def _prepare_input(self):
return (np.array(range(16), np.float32), np.array(self.param... | 121 | 3,984 |
openvino | tests/layer_tests/pytorch_tests/test_aminmax.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestAminMax(PytorchLayerTest):
def _prepare_input(self, inputs, dtype=None):
import numpy as np
return [np.array(inputs).astype(... | 60 | 2,224 |
openvino | tests/layer_tests/pytorch_tests/test_sign.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestSilu(PytorchLayerTest):
def _prepare_input(self, inp_type="mixed", out=False):
import numpy as np
inp = np.arange(0, 10).astype(np.float... | 54 | 1,661 |
openvino | tests/layer_tests/pytorch_tests/test_nms.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import pytest
from pytorch_layer_test_class import PytorchLayerTest
import numpy as np
import torch
import torchvision
@pytest.mark.parametrize('boxes_num', (1, 2, 3, 4, 5))
class TestNms(PytorchLayerTest):
def _p... | 44 | 1,547 |
openvino | tests/layer_tests/pytorch_tests/test_resolve_conj_neg.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestResolveConjNeg(PytorchLayerTest):
def _prepare_input(self, dtype="float32"):
import numpy as np
return (self.random.randn(2, 4, dtype=dt... | 58 | 1,924 |
openvino | tests/layer_tests/pytorch_tests/test_hadsigmoid.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class TestHardSigmoid(PytorchLayerTest):
def _prepare_input(self, shape, dtype):
return (self.random.randn(*shape, dtype=dtype),)
def... | 36 | 1,319 |
openvino | tests/layer_tests/pytorch_tests/test_bitwise_ops.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from packaging.version import parse as parse_version
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class TestBitwiseOp(PytorchLayerTest):
def _prepare_input(sel... | 206 | 7,633 |
openvino | tests/layer_tests/pytorch_tests/test_numel.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestNumel(PytorchLayerTest):
def _prepare_input(self, input_shape=(2)):
return (self.random.randn(*input_shape),)
def create_model(self):
... | 36 | 1,054 |
openvino | tests/layer_tests/pytorch_tests/test_full.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import numpy as np
import pytest
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
class TestFull(PytorchLayerTest):
def _prepare_input(self, value):
return (np.array(value, dtype=np.fl... | 645 | 27,716 |
openvino | tests/layer_tests/pytorch_tests/test_where.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from packaging import version
from pytorch_layer_test_class import PytorchLayerTest, skip_if_export
# torch.where with a uint8 condition tensor is deprecated in PyTorch 2.9.
_WHERE_UINT8_DE... | 184 | 8,293 |
openvino | tests/layer_tests/pytorch_tests/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
import os
from pytorch_layer_test_class import get_params
def _patch_cia_ops_cache():
"""Cache _collect_all_valid_cia_ops to speed up run_decompositions.
PyTorch's run_decompositions() calls _collect_all_valid_... | 44 | 1,527 |
openvino | tests/layer_tests/pytorch_tests/test_device.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestDevice(PytorchLayerTest):
def _prepare_input(self):
input_data = self.random.randint(127, size=(1, 3, 224, 224))
return (in... | 72 | 2,165 |
openvino | tests/layer_tests/pytorch_tests/test_multinomial.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestMultinomial(PytorchLayerTest):
def _prepare_input(self, input, num_samples, out):
model_inputs = [input, np.arra... | 101 | 3,438 |
openvino | tests/layer_tests/onnx_tests/test_non_zero.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 203 | 7,089 |
openvino | tests/layer_tests/onnx_tests/test_and.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 274 | 9,860 |
openvino | tests/layer_tests/onnx_tests/test_dropout.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestDropout(OnnxRuntimeLayerTest):
def create_net(self, shape, ratio, ir_version, opset=None):
"""
... | 177 | 5,574 |
openvino | tests/layer_tests/onnx_tests/test_log.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 199 | 7,097 |
openvino | tests/layer_tests/onnx_tests/test_identity.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 187 | 6,188 |
openvino | tests/layer_tests/onnx_tests/test_clip.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 176 | 6,936 |
openvino | tests/layer_tests/onnx_tests/test_transpose.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import itertools
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestTranspose(OnnxRuntimeLayerTest):
def create_net(self, shape, perm, ir_version):
"""... | 183 | 5,786 |
openvino | tests/layer_tests/onnx_tests/test_floor.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 183 | 6,091 |
openvino | tests/layer_tests/onnx_tests/test_split_concat.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
test_data_3D = [
dict(input_shape=[1, 50, 50], output_shapes=[[1, 50, 25], [1, 50, 25]], axis=2),
dict(input_shape=[2, 50, 50], output... | 596 | 22,576 |
openvino | tests/layer_tests/onnx_tests/test_prelu.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 152 | 6,105 |
openvino | tests/layer_tests/onnx_tests/test_leaky_relu.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 209 | 7,462 |
openvino | tests/layer_tests/onnx_tests/test_gather.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 288 | 11,422 |
openvino | tests/layer_tests/onnx_tests/test_scatter.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 135 | 5,081 |
openvino | tests/layer_tests/onnx_tests/test_sigmoid.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 201 | 6,862 |
openvino | tests/layer_tests/onnx_tests/test_bn.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestBatchNormalization(OnnxRuntimeLayerTest):
def create_net(self, shape, epsilon, precision, ir_version, opset=... | 135 | 4,580 |
openvino | tests/layer_tests/onnx_tests/test_hard_sigmoid.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 242 | 9,033 |
openvino | tests/layer_tests/onnx_tests/test_pad.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 218 | 9,044 |
openvino | tests/layer_tests/onnx_tests/test_conv_transpose.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestConvTranspose(OnnxRuntimeLayerTest):
def _prepare_input(self, inputs_dict):
for input in inputs_dict.... | 232 | 10,563 |
openvino | tests/layer_tests/onnx_tests/test_logsoftmax.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 259 | 13,429 |
openvino | tests/layer_tests/onnx_tests/test_argmax.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 160 | 6,507 |
openvino | tests/layer_tests/onnx_tests/test_relu.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 187 | 6,209 |
openvino | tests/layer_tests/onnx_tests/test_conv.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 515 | 27,290 |
openvino | tests/layer_tests/onnx_tests/test_ceil.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 199 | 6,800 |
openvino | tests/layer_tests/onnx_tests/test_flatten.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestFlatten(OnnxRuntimeLayerTest):
def create_flatten_net(self, axis, input_shape, dim, ir_version, opset=None):
"""
... | 305 | 12,244 |
openvino | tests/layer_tests/onnx_tests/test_sum.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestSum(OnnxRuntimeLayerTest):
def create_net(self, dyn_shapes, const_shapes, precision, ir_version, opset=None)... | 341 | 15,264 |
openvino | tests/layer_tests/onnx_tests/test_softplus.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 188 | 6,263 |
openvino | tests/layer_tests/onnx_tests/test_not.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 196 | 6,622 |
openvino | tests/layer_tests/onnx_tests/test_roi_align.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onn... | 151 | 6,880 |
openvino | tests/layer_tests/onnx_tests/test_elu.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 190 | 6,378 |
openvino | tests/layer_tests/onnx_tests/test_reduce.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 201 | 9,768 |
openvino | tests/layer_tests/onnx_tests/test_lrn.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 142 | 5,451 |
openvino | tests/layer_tests/onnx_tests/test_neg.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 96 | 3,225 |
openvino | tests/layer_tests/onnx_tests/test_image_scaler.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestImageScaler(OnnxRuntimeLayerTest):
def create_net(self, shape, scale, ir_version):
"""
O... | 166 | 5,238 |
openvino | tests/layer_tests/onnx_tests/test_topk.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestTopK(OnnxRuntimeLayerTest):
def create_net(self, shape, k, axis, ir_version, largest=None, sorted=None, opse... | 175 | 5,831 |
openvino | tests/layer_tests/onnx_tests/test_sqrt.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 191 | 6,589 |
openvino | tests/layer_tests/onnx_tests/test_dequantize_linear.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 224 | 10,097 |
openvino | tests/layer_tests/onnx_tests/test_xor.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
fro... | 274 | 9,860 |
openvino | tests/layer_tests/onnx_tests/test_abs.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.... | 181 | 6,046 |
openvino | tests/layer_tests/onnx_tests/test_lstm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestLSTM(OnnxRuntimeLayerTest):
skip_framework = True
def create_lstm(self, direction: str, cell_type: str,... | 167 | 5,862 |
openvino | tests/layer_tests/onnx_tests/test_squeeze.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestSqueeze(OnnxRuntimeLayerTest):
def create_squeeze_net(self, axes, input_shape, output_shape, ir_version):
"""
... | 223 | 9,173 |
openvino | tests/layer_tests/onnx_tests/test_mean_variance_normalization.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestMeanVarianceNormalization(OnnxRuntimeLayerTest):
def _prepare_input(self, inputs_dict):
for input in... | 75 | 2,263 |
openvino | tests/layer_tests/onnx_tests/test_unsqueeze.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestUnsqueeze(OnnxRuntimeLayerTest):
def create_unsqueeze_net(self, axes, input_shape, output_shape, ir_version):
"""
... | 223 | 9,296 |
openvino | tests/layer_tests/onnx_tests/test_matmul.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
class TestMatMul(OnnxRuntimeLayerTest):
def _prepare_input(self, inputs_dict):
for input in inputs_dict.keys()... | 197 | 7,058 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.