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/model_hub_tests/pytorch/test_hf_transformers.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import platform
from PIL import Image
import pytest
import torch
from models_hub_common.constants import hf_cache_dir, clean_hf_cache_dir
from models_hub_common.utils import cleanup_dir, get_models_list, retry
from torch_util... | 590 | 31,240 |
openvino | tests/model_hub_tests/pytorch/test_tpsmm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import sys
import tempfile
import pytest
import torch
import yaml
from torch_utils import TestTorchConvertModel
# To make tests reproducible we seed the random generator
torch.manual_seed(0)
class TestThi... | 71 | 2,761 |
openvino | tests/model_hub_tests/pytorch/test_gfpgan.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import sys
import tempfile
import pytest
import torch
import torchvision
from packaging import version
from torch_utils import TestTorchConvertModel
from openvino import convert_model
import numpy as np
# T... | 85 | 3,035 |
openvino | tests/model_hub_tests/pytorch/test_edsr.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import platform
import pytest
import random
import torch
from models_hub_common.constants import hf_cache_dir, clean_hf_cache_dir
from models_hub_common.utils import cleanup_dir
from torch_utils import TestTorchConvertModel, ... | 106 | 3,258 |
openvino | tests/model_hub_tests/pytorch/test_lightglue.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import sys
import tempfile
import pytest
import torch
from openvino import PartialShape
from torch_utils import TestTorchConvertModel
# To make tests reproducible we seed the random generator
torch.manual_s... | 73 | 2,531 |
openvino | tests/model_hub_tests/pytorch/test_easyocr.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import pytest
import torch
from openvino import PartialShape
from torch_utils import TestTorchConvertModel, skip_npu_precommit
# To make tests reproducible we seed the random generator
torch.manual_seed(0)
NPU_PRECOMMI... | 58 | 2,180 |
openvino | tests/model_hub_tests/pytorch/test_timm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import platform
import re
import pytest
import timm
import torch
from models_hub_common.utils import get_models_list, retry
from torch_utils import TestTorchConvertModel, skip_npu_precommit
def filter_timm(timm_list: list) ... | 191 | 7,550 |
openvino | tests/model_hub_tests/pytorch/torch_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import pytest
import torch
from models_hub_common.test_convert_model import TestConvertModel
from models_hub_common.utils import get_models_list
from openvino import convert_model, PartialShape
def flattenize_tuples(list_inpu... | 136 | 5,153 |
openvino | tests/model_hub_tests/pytorch/test_aliked.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import math
import os
import platform
import subprocess
import sys
import tempfile
import numpy as np
import openvino.opset12 as ops
import pytest
import torch
from openvino import convert_model, Model, PartialShape, Type
from openvino.... | 150 | 5,874 |
openvino | tests/model_hub_tests/pytorch/test_torchvision_models.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import platform
import pytest
import torch
from torchvision.models import list_models, get_model
from models_hub_common.utils import get_models_list, retry
from torch_utils import TestTorchConvertModel, skip_npu_precommit
d... | 131 | 5,569 |
openvino | tests/model_hub_tests/pytorch/test_torchbench.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import subprocess
import pytest
import torch
import tempfile
from torch_utils import process_pytest_marks, get_models_list, TestTorchConvertModel
# To make tests reproducible we seed the random generator
torch.manu... | 59 | 2,025 |
openvino | tests/model_hub_tests/pytorch/test_speech-transformer.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import sys
import tempfile
import pytest
import torch
from torch_utils import TestTorchConvertModel
# To make tests reproducible we seed the random generator
torch.manual_seed(0)
class TestSpeechTransform... | 62 | 2,368 |
openvino | tests/model_hub_tests/pytorch/test_llm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import copy
import inspect
from contextlib import contextmanager
import numpy as np
import platform
import pytest
import torch
from models_hub_common.utils import retry
from openvino.frontend.pytorch.patch_model import __make_16bit_tra... | 773 | 33,648 |
openvino | tests/model_hub_tests/pytorch/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from models_hub_common.utils import get_params
def pytest_generate_tests(metafunc):
test_gen_attrs_names = list(inspect.signature(get_params).parameters)
params = get_params()
metafunc.parametrize(test_gen_a... | 13 | 358 |
openvino | tests/model_hub_tests/pytorch/scripts/process_op_report.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
if __name__ == "__main__":
assert len(sys.argv) > 1, "Please provide filename"
filename = sys.argv[1]
if os.path.isfile(filename):
ops_dict = dict()
with open(filename, 'r') as f:
... | 28 | 866 |
openvino | tests/model_hub_tests/tensorflow/utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf_v1
type_map = {
tf.float64: np.float64,
tf.float32: np.float32,
tf.int8: np.int8,
tf.int16: np.int16,
tf.int32: np.int32,
tf.int64: np.... | 210 | 8,256 |
openvino | tests/model_hub_tests/tensorflow/test_tf_convert_model.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import gc
import os
import platform
import pytest
import shutil
import subprocess
import tempfile
import tensorflow as tf
import tensorflow.compat.v1 as tf_v1
import tensorflow_hub as hub
# noinspection PyUnresolvedReferences
#import ten... | 225 | 10,651 |
openvino | tests/model_hub_tests/tensorflow/test_tf_read_model.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import gc
import os
import platform
import shutil
import pytest
import tensorflow as tf
import tensorflow_hub as hub
# noinspection PyUnresolvedReferences
#import tensorflow_text # do not delete, needed for text models. Commented due t... | 158 | 7,049 |
openvino | tests/model_hub_tests/tensorflow/test_tf_hub_api_notebooks.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import platform
import pytest
import tensorflow as tf
import tensorflow_hub as hub
from models_hub_common.test_convert_model import TestConvertModel
from utils import get_input_info
class TestTFHubApiNotebooks(TestConvertModel):
... | 85 | 3,907 |
openvino | tests/model_hub_tests/tensorflow/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from models_hub_common.utils import get_params
def pytest_generate_tests(metafunc):
test_gen_attrs_names = list(inspect.signature(get_params).parameters)
params = get_params()
metafunc.parametrize(test_gen_a... | 12 | 357 |
openvino | tests/model_hub_tests/transformation_tests/test_gptq_torchfx_transformations.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from huggingface_hub import snapshot_download
from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM, pipeline
import torch
import hashlib
from openvino.frontend.pytorch.torchdynamo.execute import compiled_cache
import ... | 111 | 4,537 |
openvino | tests/model_hub_tests/transformation_tests/test_pa_transformation.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from huggingface_hub import snapshot_download
from openvino._offline_transformations import paged_attention_transformation
from openvino._pyopenvino.op import _PagedAttentionExtension
from openvino._pyopenvino import Type as OVType
from ... | 231 | 10,892 |
openvino | tests/model_hub_tests/transformation_tests/generate_ref_diffs.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
'''
Use this script if you need to regenerate reference diffs for each model
to test SDPAToPA transformation.
The script will produce sdpa2pa_ref_diff.txt (or sdpa2pa_ref_diff_optimizations.txt
if using cache-eviction) containing a map ... | 139 | 6,110 |
openvino | tests/model_hub_tests/transformation_tests/test_transformations.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from huggingface_hub import snapshot_download
import models_hub_common.utils as utils
import pytest
import os
import platform
import openvino as ov
import tempfile
from collections import deque
import csv
import torch
def parse_transfo... | 188 | 7,300 |
openvino | tests/model_hub_tests/transformation_tests/test_moe_transformation.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from huggingface_hub import snapshot_download
from optimum.intel import OVModelForCausalLM
import openvino as ov
from models_hub_common.utils import retry
import models_hub_common.utils as utils
import pytest
import os
from transformers ... | 362 | 15,028 |
openvino | tests/model_hub_tests/transformation_tests/test_stateful_to_stateless_transformation.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import openvino as ov
from huggingface_hub import snapshot_download
from openvino._offline_transformations import stateful_to_stateless_transformation
from optimum.intel import OVModelForCausalLM
from models_hub_common.utils import retry... | 100 | 5,320 |
openvino | tests/model_hub_tests/transformation_tests/sdpa2pa_ref_diff.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
nodes_to_compare = ("ScaledDotProductAttention", "PagedAttentionExtension", "Parameter", "ReadValue", "Assign")
ref_diff_map = {
"optimum-intel-internal-testing/opt-125m" : {
"Assign" : -24,
"PagedAttentionExtension" : 12,
"Param... | 921 | 25,103 |
openvino | tests/model_hub_tests/jax/test_hf_transformers.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import pytest
import requests
from huggingface_hub import snapshot_download
from PIL import Image
from models_hub_common.constants import hf_cache_dir, clean_hf_cache_dir
from models_hub_common.utils import cleanup_dir, get_mod... | 78 | 3,475 |
openvino | tests/model_hub_tests/jax/jax_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import flax
import jax
import numpy as np
from models_hub_common.test_convert_model import TestConvertModel
from openvino import convert_model
def flattenize_pytree(outputs):
leaves, _ = jax.tree_util.tree_flatten(outputs)
retu... | 41 | 1,293 |
openvino | tests/model_hub_tests/models_hub_common/utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import functools
import itertools
import os
import shutil
import time
import numpy as np
from models_hub_common.constants import test_device
def parse_list_file(file_name: str):
with open(file_name, 'r') as f_in:
for model... | 209 | 7,623 |
openvino | tests/model_hub_tests/models_hub_common/constants.py | .py | # -*- coding: utf-8 -*-
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import tempfile
'''
@brief Time in seconds of measurement performance on each of the networks. This time doesn't include
loading and heating and includes measurement only one of 2 models - got through c... | 33 | 1,441 |
openvino | tests/model_hub_tests/models_hub_common/test_performance_model.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import sys
import traceback
import time
from enum import Enum
import pytest
from openvino.utils.types import openvino_to_numpy_types_map
import models_hub_common.utils as utils
import models_hub_common.constants as const
import numpy ... | 217 | 9,584 |
openvino | tests/model_hub_tests/models_hub_common/test_convert_model.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import gc
import os
import numpy as np
# noinspection PyUnresolvedReferences
try:
import openvino_tokenizers # do not delete, needed for text models
except:
pass
from models_hub_common.multiprocessing_utils import multiprocessin... | 142 | 5,908 |
openvino | tests/model_hub_tests/models_hub_common/multiprocessing_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import os
import signal
import sys
import traceback
from multiprocessing import Process, Queue, TimeoutError, ProcessError
from queue import Empty as QueueEmpty
from typing import Union
from collections.abc import C... | 95 | 3,666 |
openvino | tests/model_hub_tests/performance_tests/test_tf_hub_performance_model.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import gc
import os
import shutil
from collections import namedtuple
from enum import Enum
import pytest
import tensorflow_hub as hub
from models_hub_common.test_performance_model import TestModelPerformance
import models_hub_common.ut... | 88 | 3,284 |
openvino | tests/model_hub_tests/performance_tests/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
import pytest
from models_hub_common.utils import get_params
from py.xml import html
from models_hub_common.utils import round_num
import json
import requests
from datetime import datetime
def pytest_sessionstart(sessio... | 81 | 2,940 |
openvino | tests/llm/accuracy_conformance.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import gc
import logging
import os
import shutil
import tempfile
import pytest
from huggingface_hub import snapshot_download
from optimum.intel.openvino import (OVModelForCausalLM,
OVWeightQuantizatio... | 259 | 10,510 |
openvino | tests/llm/conftest.py | .py | import os
def pytest_addoption(parser):
parser.addoption("--do_not_cleanup", action="store_true", default=False, help="Do not cleanup temporary files after test completion")
parser.addoption("--gpu_suffix", action="store", default="0", help="Suffix to append to GPU device name (e.g., '1' for GPU.1)")
parse... | 20 | 874 |
openvino | tests/memory_tests/tools/run_tests.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import platform
import argparse
import glob
import os
import re
import itertools
import subprocess
import json
import time
import sys
from typing import Any
from pathlib import Path
from dataclasses import dataclass, asdict
try:
... | 452 | 16,351 |
openvino | tests/time_tests/test_runner/utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Utility module."""
import numpy as np
# Define a range to cut outliers which are < Q1 − IQR_CUTOFF * IQR, and > Q3 + IQR_CUTOFF * IQR
# https://en.wikipedia.org/wiki/Interquartile_range
IQR_CUTOFF = 1.5
def calculate_iqr(stats: li... | 30 | 1,007 |
openvino | tests/time_tests/test_runner/test_timetest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Main entry-point to run timetests tests.
Default run:
$ pytest test_timetest.py
Options[*]:
--test_conf Path to test config
--exe Path to timetest binary to execute
--niter Number of times to run executable
[*... | 95 | 3,577 |
openvino | tests/time_tests/test_runner/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
"""
Basic high-level plugin file for pytest.
See [Writing plugins](https://docs.pytest.org/en/latest/writing_plugins.html)
for more information.
This plugin adds the following command-line options:
* `--test_conf` - Path to test configu... | 428 | 13,965 |
openvino | tests/time_tests/scripts/run_timetest.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""
This script runs timetest executable several times and aggregate
collected statistics.
"""
# pylint: disable=redefined-outer-name
import statistics
import tempfile
import logging
import argparse
import sys
i... | 199 | 7,033 |
openvino | tests/e2e_tests/collect_refs.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Main entry-point to collect references for E2E tests.
Default run:
$ pytest collect_refs.py
Options[*]:
--modules Paths to references
--env_conf Path to environment config
--dry_run Disable reference saving
[*] For... | 63 | 2,098 |
openvino | tests/e2e_tests/test_base.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Main entry-point to run E2E OSS tests.
Default run:
$ pytest test.py
Options[*]:
--modules Paths to tests
--env_conf Path to environment config
--test_conf Path to test config
[*] For more information see conftest.py... | 160 | 7,032 |
openvino | tests/e2e_tests/config.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
from common import config
""" TT_PRODUCT_VERSION_SUFFIX - Environment version suffix provided by user"""
product_version_suffix = os.environ.get("TT_PRODUCT_VERSION_SUFFIX", "e2e_tests")
config.product_version_suffix = produc... | 15 | 523 |
openvino | tests/e2e_tests/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pathlib
import sys
from cpuinfo import get_cpu_info
from e2e_tests.common.logger import get_logger
from .common.sys_info_utils import get_sys_info
from e2e_tests.test_utils.tf_helper import TFVersionHelper
try:
# In user_co... | 70 | 2,713 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/infer_templates.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
def batched_common_infer_step(device, **additional_args):
# return 'reshape' method for setting batch because old 'batch_size' method still not implemented in new API
return "infer", {"ie_sync": {"device": device},
... | 37 | 1,494 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/postproc_template.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""ing templates processed by testing framework.
"""
from collections import OrderedDict
from e2e_tests.common.decorators import wrap_ord_dict
@wrap_ord_dict
def squeeze(axis=(2, 3)):
"""Construct squeezing action.
:param axi... | 104 | 3,644 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/collect_reference_templates.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Common reference collection templates processed by testing framework.
"""
from collections import OrderedDict
from e2e_tests.common.decorators import wrap_ord_dict
from e2e_tests.pipelines.pipeline_templates.postproc_template import ... | 147 | 6,748 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/comparators_template.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from e2e_tests.common.decorators import wrap_ord_dict
@wrap_ord_dict
def classification_comparators(device, postproc=None, target_layers=None, precision=None, a_eps=None, r_eps=None,
ntop=10):
if post... | 120 | 4,481 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/input_templates.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
def read_npz_input(path):
return "read_input", {"npz": {"path": path}}
def read_npy_input(path):
return "read_input", {"npy": {"inputs_map": path}}
def read_ark_input(path):
return "read_input", {"ark": {"inputs_map": pat... | 34 | 764 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/preproc_templates.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Preprocessing templates processed by testing framework.
"""
from collections import OrderedDict
def assemble_preproc(batch=None,
h=None,
w=None,
resize_mode="nearest",
... | 191 | 6,930 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/model_loader_templates.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
def pytorch_loader(model_name=None,
weights=None,
output_file=None,
model_path=None,
import_module=None,
model_param=None,
... | 41 | 1,382 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/pytorch_to_onnx_converter_template.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
def convert_pytorch_to_onnx(model_name=None,
weights=None,
input_shapes=None,
output_file=None,
model_path=None,
... | 34 | 1,359 |
openvino | tests/e2e_tests/pipelines/pipeline_templates/ir_gen_templates.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from pathlib import Path
def common_ir_generation(mo_out, precision, **kwargs):
return ("get_ir", {"get_ovc_model": {"mo_out": mo_out,
"precision": precision,
... | 17 | 526 |
openvino | tests/e2e_tests/pipelines/tf_hub/tf_hub_case_class.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
from e2e_tests.common.common.common_base_class import CommonConfig
from e2e_tests.pipelines.pipeline_templates.comparators_template import eltwise_comparators
from e2e_tests.pipelines.pipeline_templat... | 31 | 1,306 |
openvino | tests/e2e_tests/pipelines/tf_hub/tf_hub.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
from e2e_tests.test_utils.test_utils import class_factory
from e2e_tests.pipelines.production.tf_hub_case_class import TFHUB_eltwise_Base
def get_models_list(file_name: str):
models = []
with open(file_nam... | 51 | 1,851 |
openvino | tests/e2e_tests/test_utils/env_tools.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from pathlib import Path
class EnvironmentConfigException(Exception):
""" Environment configuration exception """
class Environment:
"""
Environment used by tests.
:attr env: environment dictionary. populated dynami... | 45 | 1,381 |
openvino | tests/e2e_tests/test_utils/modify_configs.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
from copy import deepcopy
from e2e_tests.test_utils.reshape_tests_utils import get_mo_input_with_frozen_values, reorder_shapes_to_old_api, \
get_input_data
from e2e_tests.test_utils.test_utils imp... | 130 | 6,032 |
openvino | tests/e2e_tests/test_utils/reshape_tests_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import copy
import logging as log
import re
from collections import defaultdict
from itertools import zip_longest
from types import SimpleNamespace
import numpy as np
from e2e_tests.common.test_utils import name_aligner
from e2e_tests.... | 321 | 13,624 |
openvino | tests/e2e_tests/test_utils/get_test_info.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from collections import defaultdict
class TestInfo:
extra_info = None
e2e_models_info = None
def fill_mo_args(self, **mo_params):
if self.extra_info is None:
self.extra_info = defaultdict(list)
... | 67 | 2,859 |
openvino | tests/e2e_tests/test_utils/reshape_pipeline_executers.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
from e2e_tests.test_utils.modify_configs import ie_sbs_reshape_config, ie_reshape_config, mo_reshape_config
from e2e_tests.common.common.pipeline import Pipeline
def ie_pipeline_runner(instance_ie_pipeline, shape... | 26 | 950 |
openvino | tests/e2e_tests/test_utils/coverage_runner.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#!/usr/bin/env python3
"""
Copyright (c) 2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at... | 91 | 3,530 |
openvino | tests/e2e_tests/test_utils/path_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Path utils used across E2E tests framework."""
import datetime
import getpass
import hashlib
import logging as log
import math
import os
import re
import socket
import sys
import time
from contextlib import contextmanager
from glob i... | 228 | 8,570 |
openvino | tests/e2e_tests/test_utils/tf_hub_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import tensorflow as tf
rng = np.random.default_rng(seed=56190)
type_map = {
tf.float64: np.float64,
tf.float32: np.float32,
tf.int8: np.int8,
tf.int16: np.int16,
tf.int32: np.int32,
tf.int64:... | 82 | 2,808 |
openvino | tests/e2e_tests/test_utils/pytorch_loaders.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import importlib
import os
import sys
import torch
from huggingface_hub import snapshot_download
class LoadPyTorchModel:
def __init__(self, module: str, args: dict, inputs: dict):
self.module = module
self.args = a... | 110 | 3,216 |
openvino | tests/e2e_tests/test_utils/tf_helper.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=no-member
"""
The module contains helper class for working with TensorFlow version dependencies
"""
import os
import logging as log
from distutils.version import LooseVersion
import yaml
class TFVersionHelper:
"... | 90 | 3,487 |
openvino | tests/e2e_tests/test_utils/test_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import csv
import logging as log
import os
import re
import shutil
import sys
from pathlib import Path
from typing import Union
from filelock import FileLock
from contextlib import contextmanager
from datetime import datetime
import cop... | 494 | 19,251 |
openvino | tests/e2e_tests/common/environment_info.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import importlib
import distro
from . import config
from .logger import get_logger
logger = get_logger(__name__)
DEFAULT_BUILD_NUMBER = 0
DEFAULT_SHORT_VERSION_NUMBER = "0.0.0"
DEFAULT_FULL_VERSION_NUMBER = "{}-{}-{}".format(DEFAULT... | 103 | 3,137 |
openvino | tests/e2e_tests/common/logger.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import base64
import inspect
import logging
import os
import re
import weakref
from datetime import datetime
from typing import cast, Union
from collections.abc import Generator
from e2e_tests.common import config
SEPARATOR = "=" * 20... | 301 | 11,847 |
openvino | tests/e2e_tests/common/marks.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import re
from enum import Enum
from itertools import chain
from typing import Union
from _pytest.nodes import Item
from .config import repository_name
from .logger import get_logger
RePattern = type(re.compile(""))
logger = get_logg... | 276 | 9,671 |
openvino | tests/e2e_tests/common/sys_info_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=logging-fstring-interpolation,fixme
"""
Functions for getting system information.
"""
import os
import sys
import contextlib
import logging
import multiprocessing
import pathlib
import platform
import re
import subpro... | 435 | 14,818 |
openvino | tests/e2e_tests/common/hook_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from _pytest.python import Function
from . import config
from .config import bug_ids, components_ids, req_ids
from .logger import get_logger
from .marks import MarkGeneral, MarkRunType
logger = get_logger(__name__)
_current_test_run =... | 118 | 3,979 |
openvino | tests/e2e_tests/common/env_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Utility module with config environment utilities."""
import os
def fix_path(path, root_path=None):
"""
Fix path: expand environment variables if any, make absolute path from
root_path/path if path is relative, resolve s... | 32 | 1,088 |
openvino | tests/e2e_tests/common/table_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Common table formatting/creation utils used across E2E tests framework."""
#pylint:disable=import-error
from tabulate import tabulate
def make_table(*args, **kwargs):
"""Wrapper function for `tabulate` to unify table styles acro... | 14 | 455 |
openvino | tests/e2e_tests/common/parsers.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import xml.etree.ElementTree
def mapping_parser(file):
"""
Parse mapping file if it exists
:param file: Name of mapping file
:return: Dictionary with framework layers as keys and IR layers as values
"""
... | 42 | 1,431 |
openvino | tests/e2e_tests/common/decorators.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
def wrap_ord_dict(func):
"""Wrap values in OrderedDict."""
def wrapped(*args, **kwargs):
items = func(*args, **kwargs)
if isinstance(items, tuple):
return Ordered... | 25 | 759 |
openvino | tests/e2e_tests/common/config.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Fields for logger """
import os
import re
from .core import get_bool, get_list, get_path
class StrippingLists:
DEFAULT_SENSITIVE_KEYS_TO_BE_MASKED = [
r"(?!zabbix_operator_initial_).*pass(word)?", r".*client_id", r".*... | 118 | 5,608 |
openvino | tests/e2e_tests/common/pytest_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Pytest utility functions."""
# pylint:disable=import-error
import pytest
from multiprocessing import TimeoutError
from collections import namedtuple
from _pytest.mark import Mark, MarkDecorator
"""Mark generator to specify pytest mar... | 116 | 3,503 |
openvino | tests/e2e_tests/common/openvino_resources.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=import-error,logging-fstring-interpolation,fixme
"""
The module implements OpenVINOResources class which provide interface for getting paths to various
OpenVINO resources (tools, samples, etc) according to product ins... | 212 | 7,668 |
openvino | tests/e2e_tests/common/multiprocessing_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import os
import platform
import signal
import sys
import traceback
from logging.handlers import QueueHandler
from multiprocessing import Process, Queue, TimeoutError, ProcessError
from queue import Empty as QueueEm... | 106 | 4,058 |
openvino | tests/e2e_tests/common/core.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
def get_list(key_name, delimiter=',', fallback=None):
value = os.environ.get(key_name, fallback)
if value != fallback:
value = value.split(delimiter)
elif not value:
value = []
return value
... | 46 | 1,233 |
openvino | tests/e2e_tests/common/ref_collector/provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from e2e_tests.common.common.base_provider import BaseProvider, BaseStepProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def validate(cls):
methods = [
f[0] for f in... | 35 | 1,064 |
openvino | tests/e2e_tests/common/ref_collector/score_pytorch.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import os
import sys
from utils.path_utils import resolve_dir_path
from e2e_tests.common.ref_collector.provider import ClassProvider
class PytorchBaseRunner:
log.basicConfig(format="[ %(levelname)s ] %(messag... | 368 | 16,342 |
openvino | tests/e2e_tests/common/ref_collector/score_pytorch_onnx_runtime.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import os
import sys
from e2e_tests.common.multiprocessing_utils import multiprocessing_run
from utils.path_utils import resolve_dir_path
from e2e_tests.common.ref_collector.score_onnx_runtime import ONNXRuntimeRun... | 150 | 7,063 |
openvino | tests/e2e_tests/common/ref_collector/score_tf_lite.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from e2e_tests.common.ref_collector.provider import ClassProvider
class ScoreTensorFLowLite(ClassProvider):
__action_name__ = "score_tf_lite"
def __init__(self, config):
self.model = config["model"]
self.inputs... | 34 | 1,207 |
openvino | tests/e2e_tests/common/ref_collector/score_tf.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from e2e_tests.common.ref_collector.provider import ClassProvider
from e2e_tests.utils.path_utils import resolve_file_path, resolve_dir_path
import os
import re
import sys
import itertools
from collections import defaultdict
import loggi... | 259 | 10,355 |
openvino | tests/e2e_tests/common/ref_collector/dummy_ref_collector.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""
Dummy reference collector to be used when real collector is unavailable.
Example usage: User do not have tensorflow installed and want to run pytorch-only
tests. Tensorflow reference collector is substituted by the dummy so that no
... | 26 | 823 |
openvino | tests/e2e_tests/common/ref_collector/score_tf_hub.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import logging as log
import tensorflow as tf
from .tf_hub_ref_provider import ClassProvider
os.environ['GLOG_minloglevel'] = '3'
class ScoreTFHub(ClassProvider):
"""Reference collector for TensorFlow Hub mod... | 35 | 989 |
openvino | tests/e2e_tests/common/ref_collector/tf_hub_ref_provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from e2e_tests.common.common.base_provider import BaseProvider, BaseStepProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def validate(cls):
methods = [
f[0] for f i... | 34 | 1,028 |
openvino | tests/e2e_tests/common/ref_collector/score_paddlepaddle.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import os
import sys
from pathlib import Path
from e2e_tests.common.common.base_provider.ref_collector.provider import ClassProvider
os.environ["GLOG_minloglevel"] = "3"
class ScorePaddlePaddle(ClassProvider):
... | 60 | 2,169 |
openvino | tests/e2e_tests/common/ref_collector/score_tf_v2.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import gc
import logging as log
import os
import tempfile
from distutils.version import LooseVersion
from pathlib import Path
from utils.path_utils import resolve_dir_path
from e2e_tests.common.ref_collector.provider import ClassProvide... | 79 | 2,875 |
openvino | tests/e2e_tests/common/ref_collector/precollected.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import torch
from e2e_tests.common.ref_collector.provider import ClassProvider
from e2e_tests.test_utils.path_utils import resolve_file_path
import numpy as np
import logging as log
import sys
class PrecollectedRefs(ClassProvider):
... | 49 | 1,584 |
openvino | tests/e2e_tests/common/ref_collector/score_onnx_runtime.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import sys
from e2e_tests.common.multiprocessing_utils import multiprocessing_run
from e2e_tests.common.ref_collector.provider import ClassProvider
class ONNXRuntimeRunner(ClassProvider):
"""Base class for in... | 75 | 3,810 |
openvino | tests/e2e_tests/common/ir_provider/provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from e2e_tests.common.common.base_provider import BaseProvider, BaseStepProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def validate(cls):
methods = [
f[0] for f in... | 38 | 1,362 |
openvino | tests/e2e_tests/common/ir_provider/pregenerated.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from e2e_tests.test_utils.path_utils import resolve_file_path
from .provider import ClassProvider
import logging as log
import sys
class Pregenerated(ClassProvider):
"""Pregenerated IR provider."""
__action_name__ = "pregenerat... | 25 | 891 |
openvino | tests/e2e_tests/common/ir_provider/model_optimizer_runner.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.utils.cli_parser import parse_input_value
from openvino.tools.ovc.cli_parser import split_inputs
from e2e_tests.test_utils.test_utils import log_timestamp
from e2e_tests.test_utils.path_utils import resolve_file_p... | 144 | 6,708 |
openvino | tests/e2e_tests/common/model_loader/provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from e2e_tests.common.common.base_provider import BaseProvider, BaseStepProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def validate(cls):
methods = [
f[0] for f i... | 36 | 1,132 |
openvino | tests/e2e_tests/common/model_loader/tf_hub_model_loader.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import sys
import tensorflow_hub as hub
from e2e_tests.common.model_loader.provider import ClassProvider
class TFHubModelLoader(ClassProvider):
"""TFHub models loader runner."""
__action_name__ = "load_tf... | 35 | 1,302 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.