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
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_ep_compatibility.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import platform import sys import tempfile import unittest import onnx from onnxruntime.capi.onnxruntime_pybind11_state import ( OrtCompiledModelCompatibility, OrtDeviceEpIncompatibilityReason, get_com...
188
8,330
onnxruntime
onnxruntime/test/python/test_pep561_py_typed_marker.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """Regression test for issue #23108: PEP 561 `py.typed` marker presence.""" from __future__ import annotations import os import unittest import onnxruntime class TestPep561Marker(unittest.TestCase): def test_py_typed...
26
719
onnxruntime
onnxruntime/test/python/onnxruntime_test_float8.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # pylint: disable=C0116,W0212,R1720,C0103,C0114 import os import platform import sys import unittest import numpy as np import packaging.version as pv import parameterized from numpy.testing import assert_allclose from onnx ...
708
30,719
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_nv_tensorrt_rtx_ep_tests.py
.py
# Copyright (c) NVIDIA Corporation. All rights reserved. # Licensed under the MIT License. from __future__ import annotations import sys import unittest from collections.abc import Sequence import numpy as np import torch from autoep_helper import AutoEpTestCase from helper import get_name from numpy.testing import a...
473
19,444
onnxruntime
onnxruntime/test/python/autoep_helper.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from __future__ import annotations import os import tempfile import unittest import onnxruntime as onnxrt from onnxruntime.capi.onnxruntime_pybind11_state import Fail class AutoEpTestCase(unittest.TestCase): """ Ba...
68
2,687
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_compile_api.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from __future__ import annotations import os import platform import sys import unittest from collections.abc import Sequence import onnx from autoep_helper import AutoEpTestCase from helper import get_name, get_shared_librar...
515
22,564
onnxruntime
onnxruntime/test/python/test_pytorch_export_contrib_ops.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # pylint: disable=W0622 """Test export of PyTorch operators using ONNX Runtime contrib ops.""" import copy import io import unittest import numpy as np import onnx import parameterized import torch import onnxruntime from ...
245
8,582
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_backend_mlops.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import numpy as np from helper import get_name from onnx import load import onnxruntime.backend as backend from onnxruntime import datasets from onnxruntime.backend.backend import OnnxRuntimeBackend as ort_b...
95
3,301
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_dmlgraph.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import numpy as np from helper import get_name import onnxruntime as onnxrt class DmlGraphHelper: def __init__( self, ort_session: onnxrt.InferenceSession, input_and_output_shap...
185
8,006
onnxruntime
onnxruntime/test/python/onnxruntime_test_distributed.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import numpy as np import onnxscript from mpi4py import MPI from onnxscript import FLOAT, FLOAT16, INT64 import onnxruntime as ort MICROSOFT_OPSET = onnxscript.values.Opset(domain="com.microsoft", version=1...
1,673
63,582
onnxruntime
onnxruntime/test/python/onnx_backend_test_series.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import argparse import collections import json import os import platform import re import sys import unittest import numpy as np import onnx import onnx.backend.test.case.test_case import onnx.backend.test.runner import onnx...
242
10,394
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_global_threadpool.py
.py
# pylint: disable=C0115,W0212,C0103,C0114 import unittest import numpy as np from helper import get_name import onnxruntime as onnxrt class TestGlobalThreadPool(unittest.TestCase): @classmethod def setUpClass(cls): onnxrt.set_global_thread_pool_sizes(2, 2) def test_global_threadpool(self): ...
37
1,363
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_mlops.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os # noqa: F401 # -*- coding: UTF-8 -*- import unittest import numpy as np from helper import get_name import onnxruntime as onnxrt available_providers = [ ( ep, {"enable_cann_subgraph": True},...
229
9,745
onnxruntime
onnxruntime/test/python/onnxruntime_test_collective.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import numpy as np from mpi4py import MPI from onnx import TensorProto, helper from parameterized import parameterized import onnxruntime as ort class ORTBertPretrainTest(unittest.TestCase): @staticmeth...
394
16,257
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_nested_control_flow_op.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest from collections.abc import Sequence from copy import deepcopy import numpy as np from onnx import ModelProto, NodeProto, TensorProto, ValueInfoProto, checker, helper import onnxruntime as ort def make_vi_...
260
9,037
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_symlink_data.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import shutil import struct import tempfile import unittest import numpy as np from onnx import TensorProto, helper, save import onnxruntime as ort class TestSymLinkOnnxModelExternalData(unittest.TestCase): ...
260
11,558
onnxruntime
onnxruntime/test/python/onnxruntime_test_python.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from __future__ import annotations import copy import ctypes import gc import importlib.util import os import pathlib import platform import queue import sys import threading import unittest import numpy as np from helper im...
2,447
115,805
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_keras.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -*- coding: UTF-8 -*- # Taken from https://github.com/onnx/onnxmltools/blob/master/tests/end2end/test_custom_op.py. import unittest import numpy as np import onnxmltools from keras import Sequential from keras import backe...
84
2,564
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_cudagraph.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import numpy as np from helper import get_name import onnxruntime as onnxrt class CudaGraphHelper: def __init__( self, ort_session: onnxrt.InferenceSession, input_and_output_sha...
265
12,418
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_symbolic_shape_infer.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import numpy # -*- coding: UTF-8 -*- import onnx from onnx import AttributeProto, GraphProto, TensorProto, helper, numpy_helper # noqa: F401 if os.path.exists( os.path.join( os.path.dirname(__file__)...
853
32,512
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_autoep.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from __future__ import annotations import os import platform import sys import unittest from collections.abc import Sequence import numpy as np import onnx from autoep_helper import AutoEpTestCase from helper import get_name...
491
21,391
onnxruntime
onnxruntime/test/python/onnxruntime_test_engine_wrapper.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import unittest import numpy as np import onnx from helper import get_name from onnx import TensorProto, helper import onnxruntime as onnxrt class TestInferenceSessionWithCtxNode(unittest.TestCase): trt_engi...
101
3,271
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_azure.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import onnxruntime as ort class TestAzureEP(unittest.TestCase): def test_availability(self): self.assertIn("AzureExecutionProvider", ort.get_available_providers()) if __name__ == "__main__": ...
16
339
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_preload_dlls.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # pylint: disable=C0114,C0115,C0116,W0212 import unittest import onnxruntime class TestGetNvidiaDllPaths(unittest.TestCase): """Unit tests for the private _get_nvidia_dll_paths helper that locates CUDA/cuDNN librari...
80
4,370
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_sparse_matmul.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # pylint: disable=C0115,W0212,C0103,C0114 # -*- coding: UTF-8 -*- import unittest import numpy as np from helper import get_name import onnxruntime as onnxrt from onnxruntime.capi.onnxruntime_pybind11_state import OrtValue...
435
10,641
onnxruntime
onnxruntime/test/python/helper.py
.py
import os import sys def get_name(name): if os.path.exists(name): return name rel = os.path.join("testdata", name) if os.path.exists(rel): return rel this = os.path.dirname(__file__) data = os.path.join(this, "..", "testdata") res = os.path.join(data, name) if os.path.exist...
28
707
onnxruntime
onnxruntime/test/python/onnxruntime_test_scatternd.py
.py
import itertools import json import os import typing import unittest import warnings import numpy as np import onnx.helper as oh from onnx import TensorProto, load from onnx.numpy_helper import from_array from onnx.reference import ReferenceEvaluator import onnxruntime def has_cuda(): available_providers = list...
330
12,894
onnxruntime
onnxruntime/test/python/onnx_node_test_equivalence_test.py
.py
#!/usr/bin/env python # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """Retiring equivalence test for materialize_onnx_node_tests.py. Proves the build-time-materialized node-test tree is byte-identical to ONNX's still-present on-disk golden corpus (``.../onnx/backend/tes...
178
7,486
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_ort_parallel.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import ctypes import sys import threading import time import unittest import numpy as np from helper import get_name import onnxruntime as onnxrt class ThreadObj: def __init__(self, model_path: str, iterations: int, i...
155
5,308
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_iobinding.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # pylint: disable=C0115,W0212,C0103,C0114 import unittest import numpy as np from helper import get_name from numpy.testing import assert_almost_equal from onnx import TensorProto, helper import onnxruntime as onnxrt from o...
477
21,874
onnxruntime
onnxruntime/test/python/onnxruntime_test_python_backend.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -*- coding: UTF-8 -*- import os import tempfile import unittest import numpy as np from helper import get_name from numpy.testing import assert_allclose import onnxruntime as onnxrt import onnxruntime.backend as backend ...
194
10,107
onnxruntime
onnxruntime/test/python/onnxruntime_test_float8_gemm8.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # pylint: disable=C0116,W0212,R1720,C0103,C0114 # # Note: the precision is different on V100, H100 even with the same code. # The thresholds were adjusted on H100 as the precision seems lower on this machine. import itertools...
343
13,603
onnxruntime
onnxruntime/test/python/contrib_ops/profile_matmul_block_scaled.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------- """ Accuracy and latency harness for the CUDA MatMulBlockQuantizedFp8Wei...
507
20,344
onnxruntime
onnxruntime/test/python/contrib_ops/onnx_test_torch_embedding.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # # Test reference implementation and model for ONNX Runtime conrtib op torch_embedding import unittest import numpy as np import onnx from onnx_contrib_ops_helper import expect def torch_embedding_reference_implementation...
99
3,300
onnxruntime
onnxruntime/test/python/contrib_ops/onnx_test_trilu.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # # Test reference implementation and model for ONNX Runtime conrtib op trilu import unittest import numpy as np import onnx from onnx_contrib_ops_helper import expect def triu_reference_implementation(x, k=0): return ...
291
8,902
onnxruntime
onnxruntime/test/python/contrib_ops/onnx_contrib_ops_helper.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # # Helper functions for generating ONNX model and data to test ONNX Runtime contrib ops import os import shutil import subprocess import onnx from onnx import numpy_helper TOP_DIR = os.path.realpath(os.path.dirname(__file_...
81
2,760
onnxruntime
onnxruntime/test/python/contrib_ops/aten_op_tests.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import io import unittest import numpy as np import onnx import torch from onnx import TensorProto, helper from ort_torch_ext import init_aten_op_executor from torch.onnx import export import onnxruntime as ort class Ort...
132
5,664
onnxruntime
onnxruntime/test/python/quantization/test_op_matmulnbits_prepacked_cuda.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
323
14,932
onnxruntime
onnxruntime/test/python/quantization/test_subgraph.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os...
73
3,126
onnxruntime
onnxruntime/test/python/quantization/test_op_flatten.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
174
6,458
onnxruntime
onnxruntime/test/python/quantization/test_calibration.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
815
34,524
onnxruntime
onnxruntime/test/python/quantization/test_op_matmul_8bits.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
221
8,340
onnxruntime
onnxruntime/test/python/quantization/test_qnn_preprocess_model.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
291
12,826
onnxruntime
onnxruntime/test/python/quantization/test_static_quantize_runner.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import co...
569
26,244
onnxruntime
onnxruntime/test/python/quantization/test_op_attention.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
115
4,619
onnxruntime
onnxruntime/test/python/quantization/test_qdq_block_size.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
269
11,602
onnxruntime
onnxruntime/test/python/quantization/test_quant_issues.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os ...
217
10,084
onnxruntime
onnxruntime/test/python/quantization/test_symmetric_flag.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
265
11,313
onnxruntime
onnxruntime/test/python/quantization/test_quantizeblockwise_2bits.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
152
7,180
onnxruntime
onnxruntime/test/python/quantization/test_op_transpose.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
166
6,207
onnxruntime
onnxruntime/test/python/quantization/test_op_topk.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import un...
104
4,121
onnxruntime
onnxruntime/test/python/quantization/test_quantizeblockwise_4bits.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
140
6,555
onnxruntime
onnxruntime/test/python/quantization/test_minimum_real_range_option.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
107
4,325
onnxruntime
onnxruntime/test/python/quantization/test_op_embed_layernorm.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
225
8,778
onnxruntime
onnxruntime/test/python/quantization/test_onnx_model.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
174
6,724
onnxruntime
onnxruntime/test/python/quantization/test_quant_util.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
235
11,095
onnxruntime
onnxruntime/test/python/quantization/test_quantizeblockwise_bnb4.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
136
5,285
onnxruntime
onnxruntime/test/python/quantization/test_get_qdq_config.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
490
21,566
onnxruntime
onnxruntime/test/python/quantization/test_op_reshape.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
170
6,386
onnxruntime
onnxruntime/test/python/quantization/test_op_relu.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
229
8,231
onnxruntime
onnxruntime/test/python/quantization/test_op_pooling.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
178
6,487
onnxruntime
onnxruntime/test/python/quantization/test_quantizer_shape_inference.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
93
3,724
onnxruntime
onnxruntime/test/python/quantization/test_op_slice.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
154
6,272
onnxruntime
onnxruntime/test/python/quantization/test_op_matmul_2bits.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
224
8,163
onnxruntime
onnxruntime/test/python/quantization/test_op_maxpool.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
328
13,819
onnxruntime
onnxruntime/test/python/quantization/test_op_gather_elems.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
111
4,145
onnxruntime
onnxruntime/test/python/quantization/test_qdq.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
2,604
119,537
onnxruntime
onnxruntime/test/python/quantization/bench_matmul_8bits.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------- """ Benchmark performance of MatMulNBits for CUDA in ONNX Runtime. """ ...
671
23,257
onnxruntime
onnxruntime/test/python/quantization/test_op_where.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import un...
155
5,939
onnxruntime
onnxruntime/test/python/quantization/test_op_matmul_bnb4.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
179
5,759
onnxruntime
onnxruntime/test/python/quantization/test_op_conv_transpose.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
183
7,006
onnxruntime
onnxruntime/test/python/quantization/test_tensor_quant_overrides_option.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
1,272
58,991
onnxruntime
onnxruntime/test/python/quantization/test_quant_preprocess.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
242
9,369
onnxruntime
onnxruntime/test/python/quantization/test_quantize_static_resnet.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os ...
139
6,225
onnxruntime
onnxruntime/test/python/quantization/test_op_squeeze_unsqueeze.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
248
9,177
onnxruntime
onnxruntime/test/python/quantization/test_quantize_static.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
176
7,696
onnxruntime
onnxruntime/test/python/quantization/test_op_matmul.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
482
19,032
onnxruntime
onnxruntime/test/python/quantization/test_fusions.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
402
18,969
onnxruntime
onnxruntime/test/python/quantization/test_conv_dynamic.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
124
5,020
onnxruntime
onnxruntime/test/python/quantization/test_qdq_loss_debug.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Tests ...
320
13,563
onnxruntime
onnxruntime/test/python/quantization/test_op_gavgpool.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
143
5,578
onnxruntime
onnxruntime/test/python/quantization/test_qoperator_adjust_int32_bias.py
.py
import os import tempfile import unittest import numpy as np import onnx from op_test_utils import TestDataFeeds, check_model_correctness from onnxruntime.quantization import QuantFormat, QuantType, quantize_static class TestAdjustWeightScaleForInt32BiasQOperator(unittest.TestCase): @classmethod def setUpCl...
106
4,687
onnxruntime
onnxruntime/test/python/quantization/test_op_gemm.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
846
32,702
onnxruntime
onnxruntime/test/python/quantization/test_op_resize.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
211
7,988
onnxruntime
onnxruntime/test/python/quantization/test_op_softmax.py
.py
#!/usr/bin/env python """ Softmax quantization test case """ # coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------...
292
10,721
onnxruntime
onnxruntime/test/python/quantization/resnet_code.py
.py
import numpy from onnx import numpy_helper from onnx.helper import make_graph, make_model, make_node, make_opsetid, make_tensor_value_info, set_model_props def create_model(): initializers = [] nodes = [] inputs = [] outputs = [] functions = [] # opsets opsets = {"": 13} # initialize...
13,758
407,364
onnxruntime
onnxruntime/test/python/quantization/test_op_instance_normalization.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
157
5,722
onnxruntime
onnxruntime/test/python/quantization/test_op_pad.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
688
28,908
onnxruntime
onnxruntime/test/python/quantization/bench_matmul_2bits.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------- """ Benchmark for MatMulNBits 2-bit dequantization...
321
11,069
onnxruntime
onnxruntime/test/python/quantization/test_mixed_prec_quant_overrides_fixer.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
172
7,746
onnxruntime
onnxruntime/test/python/quantization/op_test_utils.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from __fut...
674
27,067
onnxruntime
onnxruntime/test/python/quantization/test_op_concat.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import un...
186
6,818
onnxruntime
onnxruntime/test/python/quantization/test_op_argmax.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
199
7,331
onnxruntime
onnxruntime/test/python/quantization/test_op_matmul_4bits.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------...
603
26,513
onnxruntime
onnxruntime/test/python/quantization/test_op_split.py
.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import un...
159
5,916
onnxruntime
onnxruntime/test/python/transformers/test_generation.py
.py
#!/usr/bin/env python # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------...
551
20,884
onnxruntime
onnxruntime/test/python/transformers/test_gqa_cpu.py
.py
# -------------------------------------------------------------------------- # Copyright 2020 The HuggingFace Inc. team # # 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 http://www.apache.org/l...
2,752
94,725
onnxruntime
onnxruntime/test/python/transformers/test_parity_t5_mha.py
.py
# -------------------------------------------------------------------------- # Copyright 2020 The HuggingFace Inc. team # # 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 http://www.apache.org/l...
877
35,210
onnxruntime
onnxruntime/test/python/transformers/test_qmoe_nvfp4_cuda.py
.py
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- # # Tes...
899
35,421
onnxruntime
onnxruntime/test/python/transformers/test_simplified_layernorm_fusion.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os import unittest import numpy as np import onnx from onnx import TensorPr...
243
9,113