repo stringlengths 1 99 | file stringlengths 13 215 | code stringlengths 12 59.2M | file_length int64 12 59.2M | avg_line_length float64 3.82 1.48M | max_line_length int64 12 2.51M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/framework.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
"""
# End-to-end testing framework for TorchScript.
For the purp... | 15,736 | 41.647696 | 113 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/debug/lockstep.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from typing import Any, Dict, List, Tuple
from collections impo... | 6,387 | 43.985915 | 155 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import ctypes
import numpy as np
from torch_mlir.ir import *
fr... | 7,152 | 33.389423 | 103 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/linalg_on_tensors_backends/abc.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import abc
from typing import TypeVar
import torch
from torch_... | 1,782 | 34.66 | 79 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/tosa_backends/linalg_on_tensors.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from torch_mlir.ir import *
from torch_mlir.passmanager import *... | 2,630 | 36.585714 | 102 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/tosa_backends/abc.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import abc
from typing import TypeVar
import torch
from torch_... | 1,712 | 33.26 | 79 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/lazy_tensor_core.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch_mlir._mlir_libs._REFERENCE_LAZY_BACKEND as lazy_bac... | 1,574 | 35.627907 | 96 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/native_torch.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestConf... | 1,120 | 36.366667 | 79 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/torchscript.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import copy
from typing import Any
import torch
from torch_mli... | 1,286 | 33.783784 | 79 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/linalg_on_tensors_backend.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from typing import Any
import torch
import torch_mlir
from tor... | 1,861 | 34.807692 | 85 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/utils.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from typing import Any
import numpy as np
import torch
def re... | 1,648 | 34.085106 | 79 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/torchdynamo.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from typing import List, Union, Optional, Sequence
import numpy... | 5,787 | 36.830065 | 94 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/stablehlo_backend.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from typing import Any
import torch
import torch_mlir
from tor... | 1,773 | 35.958333 | 83 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/__init__.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from .lazy_tensor_core import LazyTensorCoreTestConfig
from .lin... | 631 | 47.615385 | 79 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/configs/tosa_backend.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from typing import Any
import torch
import torch_mlir
from tor... | 1,897 | 35.5 | 84 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/pooling.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 22,216 | 30.603129 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/squeeze.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 5,609 | 23.605263 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/vision_models.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
import torchvision.models as models
from torch_mli... | 3,163 | 28.296296 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/reduction.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 26,449 | 28.887006 | 95 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/histogram_binning_calibration.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 4,764 | 45.262136 | 119 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/elementwise_comparison.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 22,236 | 27.582262 | 83 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/control_flow.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from numpy import int64
import torch
import random
from torch_m... | 1,702 | 28.362069 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/type_conversion.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 7,467 | 28.171875 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/stats.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 26,904 | 24.771073 | 83 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/quantized_models.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch import nn
from torch_mlir_e2e_test.fram... | 1,679 | 27 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/norm_like.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 15,052 | 32.229581 | 81 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/cast.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 3,334 | 25.68 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/mlp.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
import torch.nn as nn
from torch_mlir_e2e_test.fra... | 3,131 | 29.705882 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/custom_op_example.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 1,234 | 33.305556 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/nll_loss.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 17,631 | 32.973025 | 86 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/scalar_comparison.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 4,889 | 24.206186 | 82 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/scatter.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 38,252 | 32.555263 | 116 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/rng.py | import torch
from torch_mlir_e2e_test.framework import TestUtils
from torch_mlir_e2e_test.registry import register_test_case
from torch_mlir_e2e_test.annotations import annotate_args, export
# ==============================================================================
class UniformModule(torch.nn.Module):
de... | 15,908 | 27.257549 | 95 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/constant_alloc.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 36,626 | 23.240238 | 84 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/argmax.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import torch
from torch_mlir_e2e_test.framework import TestUtils
from torch_mlir_e2e_test.registry import register_te... | 1,850 | 27.045455 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/type_promotion.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 3,234 | 27.377193 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/scalar.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 10,803 | 24.067285 | 82 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/matmul.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 6,417 | 27.149123 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/threshold.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 8,591 | 26.716129 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/backprop.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 9,224 | 29.245902 | 104 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/__init__.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
# Lists of tests that fail to even reach the backends.
# These r... | 2,014 | 31.5 | 79 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/conv.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtils... | 27,718 | 36.458108 | 94 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/reshape_like.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import torch
from torch_mlir_e2e_test.framework import TestUtils
from torch_mlir_e2e_test.registry import register_te... | 19,911 | 26.927069 | 92 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/elementwise.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 82,445 | 24.910119 | 122 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/slice_like.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 22,583 | 28.103093 | 110 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/basic.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import functorch
import torch
from torch_mlir_e2e_test.framewor... | 111,261 | 24.971522 | 187 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/index_select.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 4,759 | 27.848485 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/arange.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 5,804 | 22.12749 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/test_suite/return_types.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
from torch_mlir_e2e_test.framework import TestUtil... | 2,485 | 26.318681 | 80 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/stablehlo_backends/linalg_on_tensors.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from torch_mlir.ir import *
from torch_mlir.passmanager import *... | 1,853 | 35.352941 | 221 | py |
torch-mlir | torch-mlir-main/python/torch_mlir_e2e_test/stablehlo_backends/abc.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import abc
from typing import TypeVar
import torch
from torch_... | 1,743 | 33.196078 | 79 | py |
torch-mlir | torch-mlir-main/e2e_testing/main.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import argparse
import re
import sys
from torch_mlir_e2e_test.f... | 7,045 | 41.963415 | 155 | py |
torch-mlir | torch-mlir-main/e2e_testing/xfail_sets.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
# This file describes the sets of tests expected to fail for eac... | 55,264 | 39.725866 | 560 | py |
torch-mlir | torch-mlir-main/test/lit.cfg.py | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import os
import platform
import re
import subprocess
import tem... | 2,956 | 35.506173 | 100 | py |
torch-mlir | torch-mlir-main/test/python/smoketest.py | # RUN: %PYTHON %s
import torch_mlir.ir
from torch_mlir.dialects import torch
with torch_mlir.ir.Context() as ctx:
torch.register_dialect(ctx)
with torch_mlir.ir.Location.unknown() as loc:
module = torch_mlir.ir.Module.create(loc)
with torch_mlir.ir.InsertionPoint.at_block_begin(module.body):
n = tor... | 368 | 29.75 | 66 | py |
torch-mlir | torch-mlir-main/test/python/custom_op_shape_dtype_fn.py | import os
import tempfile
from typing import List, Tuple
import torch
import torch.utils.cpp_extension
import torch_mlir
from torch_mlir_e2e_test.annotations import export, annotate_args
# RUN: %PYTHON %s | FileCheck %s
def identity(x: torch.Tensor):
return x
goofy_lib = torch.library.Library("goofy", "DEF")... | 1,862 | 24.875 | 133 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/get_registered_ops.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
# RUN: %PYTHON %s | FileCheck %s
from torch_mlir._mlir_libs._jit_ir_importer import get_registered_ops
# This check is just for a built-in op that is unlikely to change (and is
# otherwise insignific... | 702 | 53.076923 | 315 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/debug-info.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: func.func @__torch__.add3
# Note that line-level... | 1,106 | 34.709677 | 80 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/prim.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ClassAnnotator, ImportOptions, ModuleBuilder
from utils import create_script_function
import typing
# RUN: %PYTHON %... | 8,857 | 44.193878 | 153 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/classes.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch._C import CompilationUnit
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
import typing
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
m... | 1,068 | 31.393939 | 163 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/types-bool.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK: @__torch__.returns_bool
@mb.import_fu... | 563 | 23.521739 | 67 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/types-none.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK: @__torch__.returns_none
@mb.import_fu... | 557 | 23.26087 | 67 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/function-derefine.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
import typing
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: func.func @__t... | 1,549 | 35.046512 | 110 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/loop.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
import typing
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: func.func @__t... | 3,599 | 48.315068 | 130 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/union.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
from typing import Union
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: fun... | 590 | 22.64 | 86 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/function-block-arg-adjustment.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
from utils import create_script_function
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: ... | 922 | 35.92 | 124 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/errors.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import enum
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
class Color(enum.Enum):
RED = 1
GREEN = 2
# RUN: %PYTHON %s
mb = ModuleBuilder()
# To test errors... | 679 | 19.606061 | 74 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/utils.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
# Helpers for the other tests.
import torch
from torch._C import CompilationUnit
# RUN: %PYTHON %s
# Import TorchScript IR string as ScriptFunction.
def create_script_function(func_name, ts_ir_str, ... | 439 | 26.5 | 80 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/dict.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
import collections
from typing import Tuple, Optional, List, NamedTuple, Dict
# RUN: %PYTHON %s | torch-mlir-opt | File... | 1,582 | 34.977273 | 102 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/if.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# Note: The "if without else" case is handled ... | 2,170 | 37.767857 | 108 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/elif.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: @__torch__.f
@mb.import_functio... | 778 | 21.911765 | 77 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/tuple.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
from typing import Tuple, Optional, NamedTuple
from utils import create_script_function
# RUN: %PYTHON %s | torch-mlir... | 3,713 | 46.012658 | 192 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/unimplemented.py | import torch
import torch_mlir
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
class Inner(object):
# CHECK-LABEL: func.func private @__torch__.Inner.foo(
# CHECK-SAME: %[[ARG:.*]]: !torch.nn.Module<"__torch__.Inner">) {
# CHECK: torch.constant.int 42
# CHECK: torch.prim.Store "... | 1,964 | 42.666667 | 159 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/node_import/list.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: func.func @__torch__.f(
# CHE... | 789 | 29.384615 | 130 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/methods-locations.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Module):
def __init_... | 772 | 27.62963 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/prim.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Modul... | 1,429 | 34.75 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/quantization.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# UNSUPPORTED: system-darwin
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# ... | 1,975 | 42.911111 | 194 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/functions-that-call-methods.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# Interesting test case, where ... | 2,214 | 43.3 | 163 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/methods-derefine.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Mod... | 1,358 | 36.75 | 184 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/functions.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: func.func pr... | 1,551 | 35.093023 | 125 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/debug-module-name.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK: module attributes {tor... | 704 | 28.375 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/dict.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
from typing import Dict, Optional
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class Test... | 1,435 | 34.9 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/submodules-select.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class Submodule(torch.nn.Module... | 1,225 | 28.190476 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/tensors-value-semantics.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ClassAnnotator, ImportOptions, ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
... | 1,980 | 45.069767 | 198 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/primitives.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Modul... | 1,345 | 31.829268 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/object-identity.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Modul... | 861 | 28.724138 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/methods.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# Function names in the Torch ... | 1,586 | 35.068182 | 122 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/submodules.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class Submodule(torch.nn.Module... | 1,655 | 30.846154 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/tuple.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Modul... | 1,068 | 30.441176 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/object-identity-error.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: not %PYTHON %s 2>&1 | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Module):
... | 864 | 29.892857 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/object-identity-error-submodule.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: not %PYTHON %s 2>&1 | FileCheck %s
mb = ModuleBuilder()
class Submodule(torch.nn.Module):
d... | 1,043 | 29.705882 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/tensors.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Modul... | 4,723 | 62.837838 | 199 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/strings.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Modul... | 961 | 28.151515 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/object-identity-torch-bug.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# TorchScript doesn't model obj... | 1,592 | 34.4 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/list.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Modul... | 1,093 | 31.176471 | 112 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/annotations/export.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ClassAnnotator, ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule... | 1,358 | 32.146341 | 109 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/annotations/arg-tensor-type-bound.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ClassAnnotator, ModuleBuilder
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
class TestModule... | 1,230 | 31.394737 | 109 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/annotations/arg-error.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ClassAnnotator, ModuleBuilder
# RUN: %PYTHON %s | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Module... | 1,338 | 26.895833 | 107 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/annotations/class-annotator-repr.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ClassAnnotator, ModuleBuilder
# RUN: %PYTHON %s | FileCheck %s
mb = ModuleBuilder()
class Submodule(torch.nn.Module)... | 3,453 | 30.117117 | 83 | py |
torch-mlir | torch-mlir-main/test/python/importer/jit_ir/ivalue_import/annotations/export-error.py | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
import typing
import torch
from torch_mlir.dialects.torch.importer.jit_ir import ClassAnnotator, ModuleBuilder
# RUN: %PYTHON %s | FileCheck %s
mb = ModuleBuilder()
class TestModule(torch.nn.Module)... | 1,314 | 27.586957 | 109 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.