未验证 提交 6a8847f3 编写于 作者: Z zhangjingwei 提交者: GitHub

[CodeStyle][CINN] format import region in python code via isort (#54963)

Co-authored-by: NSigureMo <sigure.qaq@gmail.com>
上级 4d7ddb49
......@@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import subprocess
import sys
def main():
......
......@@ -18,9 +18,6 @@ extend_skip_glob = [
# see .flake8 for more details
"python/paddle/fluid/**",
"python/paddle/utils/gast/**",
# Temporarily ignore CINN files, it will fix later
"python/cinn/**",
"test/cinn/**",
]
[tool.ruff]
......
......@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from .core_api.backends import ExecutionOptions
from .core_api.backends import ExecutionEngine
from .core_api.backends import ExecutionEngine, ExecutionOptions
......@@ -12,9 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from .core_api.common import make_const
from .core_api.common import Target
from .core_api.common import Type
from .core_api.common import CINNValue
from .core_api.common import Void, Int, UInt, Float, Bool, String
from .core_api.common import *
from .core_api.common import (
Bool,
CINNValue,
Float,
Int,
String,
Target,
Type,
UInt,
Void,
make_const,
)
......@@ -12,7 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from .core_api.lang import Buffer
from .core_api.lang import lower
from .core_api.lang import compute
from .core_api.lang import *
from .core_api.lang import Buffer, compute, lower
......@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from .core_api.optim import simplify
from .core_api.optim import ir_copy
from .core_api.optim import ir_copy, simplify
......@@ -12,13 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import os
import shutil
import numpy as np
import unittest
import cinn
import numpy as np
from cinn.auto_schedule.cost_model import CostModel
......
......@@ -14,9 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import paddle
import paddle.static as static
import numpy as np
def conv2d_native(inputs_data, input_shape, filter_size, attrs, is_depthwise):
......
......@@ -12,9 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
import numpy
import sys, os
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.static as static
......
......@@ -14,9 +14,12 @@
"""
A fake model with multiple FC layers to test CINN on a more complex model.
"""
import os
import sys
import numpy
import sys, os
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.static as static
......
......@@ -12,10 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
import numpy
import paddle
import sys, os
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.static as static
......
......@@ -13,6 +13,7 @@
# limitations under the License.
import unittest
from fusion_test import FusionTest
......
......@@ -13,6 +13,7 @@
# limitations under the License.
import unittest
from fusion_test import FusionTest
......
......@@ -13,6 +13,7 @@
# limitations under the License.
import unittest
from fusion_test import FusionTest
......
......@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from ast import arg
import os
import logging
import os
import sys
from ast import arg
import paddle
from paddle.static import Variable as PaddleVariable
from paddle.fluid.layer_helper import LayerHelper
from cinn.frontend import NetBuilder, PaddleModelConvertor
from cinn.common import is_compiled_with_cuda
from cinn.framework import Scope
from cinn.frontend import NetBuilder, PaddleModelConvertor
import sys
import paddle
from paddle.fluid.layer_helper import LayerHelper
from paddle.static import Variable as PaddleVariable
sys.path.append("/work/dev_CINN/build/python/tests")
from test.cinn.ops.op_test import OpTest, OpTestTool
......
......@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import unittest
from op_mapper_test import OpMapperTest
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_mapper_test import OpMapperTest
import paddle
class TestArgmaxOp(OpMapperTest):
......
......@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import unittest
from op_mapper_test import OpMapperTest
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_mapper_test import OpMapperTest
import paddle
class TestArgminOp(OpMapperTest):
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -13,8 +13,10 @@
# limitations under the License.
import unittest
from op_mapper_test import OpMapperTest
import numpy as np
from op_mapper_test import OpMapperTest
import paddle
......
......@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import random
import unittest
from op_mapper_test import OpMapperTest
import paddle
class TestClipOp(OpMapperTest):
def init_input_data(self):
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,7 +15,9 @@
# limitations under the License.
import unittest
from op_mapper_test import OpMapperTest
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import functools
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
import functools
class TestLayerNormOp(OpMapperTest):
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -13,8 +13,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -13,8 +13,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -13,9 +13,11 @@
# limitations under the License.
import unittest
import paddle
from op_mapper_test import OpMapperTest
from cinn.common import *
from op_mapper_test import OpMapperTest
import paddle
@unittest.skipIf(
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,7 +15,9 @@
# limitations under the License.
import unittest
from op_mapper_test import OpMapperTest
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -14,12 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import paddle
import random
import unittest
import numpy as np
from op_mapper_test import OpMapperTest
import paddle
class TestScatterOp(OpMapperTest):
def init_input_data(self):
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -13,8 +13,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,7 +15,9 @@
# limitations under the License.
import unittest
from op_mapper_test import OpMapperTest
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -15,8 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
from op_mapper_test import OpMapperTest, logger
import paddle
......
......@@ -12,18 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import os
import struct
import unittest
from contextlib import contextmanager
import numpy as np
from cinn import Target
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from cinn.runtime import seed as cinn_seed
import numpy as np
import paddle
import logging
from contextlib import contextmanager
import os
import struct
import paddle
logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO').upper())
logger = logging.getLogger(name="op_test")
......
......@@ -12,14 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import argparse
import itertools
import unittest
import re
import sys
import unittest
from typing import List, Union
from unittest import suite
from typing import Union, List
parser = argparse.ArgumentParser(description="Argparse for op test helper")
parser.add_argument(
......
......@@ -15,11 +15,13 @@
# limitations under the License.
import unittest
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,12 +13,13 @@
# limitations under the License.
import numpy as np
import paddle
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -15,13 +15,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import paddle.nn.functional as F
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -12,11 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,14 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest, sys
import sys
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,12 +15,14 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,14 +13,15 @@
# limitations under the License.
import unittest
import numpy as np
from op_test import OpTest, OpTestTool
import paddle
from struct import pack, unpack
import cinn
from cinn.frontend import *
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from struct import pack, unpack
import paddle
@OpTestTool.skip_if(
......
......@@ -13,11 +13,12 @@
# limitations under the License.
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,14 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
import sys
class TestBroadcastToOp(OpTest):
......
......@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,13 +15,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -15,12 +15,13 @@
# limitations under the License.
import numpy as np
import paddle
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -15,12 +15,13 @@
# limitations under the License.
import numpy as np
import paddle
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
INT32_MAX = (1 << 31) - 1
INT32_MIN = -(1 << 31)
INT64_MAX = (1 << 63) - 1
......
......@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -13,17 +13,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
import paddle
import unittest
from cinn.frontend import *
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from cinn.runtime import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
set_cinn_cudnn_deterministic(True)
paddle.fluid.set_flags({'FLAGS_cudnn_deterministic': 1})
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn as nn
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -15,14 +15,16 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn.functional as F
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,16 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import os
import unittest
from itertools import product
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
import logging
import os
from itertools import product
logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO').upper())
logger = logging.getLogger(name="gather_nd")
......
......@@ -14,17 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import os
import unittest
from itertools import product
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
import logging
import os
from itertools import product
logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO').upper())
logger = logging.getLogger(name="gather")
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,14 +15,16 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn.functional as F
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,11 +15,13 @@
# limitations under the License.
import unittest
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import unittest
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import unittest
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import unittest
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
class TestLogOp(OpTest):
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn.functional as F
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,14 +15,16 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn.functional as F
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,13 +15,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,15 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import paddle.nn.functional as F
import cinn
from cinn.frontend import *
from cinn.common import *
import sys
@OpTestTool.skip_if(
......
......@@ -15,11 +15,12 @@
# limitations under the License.
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,14 +15,16 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn.functional as F
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
from cinn.frontend import *
from cinn.common import *
from paddle import _C_ops
......
......@@ -15,12 +15,13 @@
# limitations under the License.
import numpy as np
import paddle
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
INT32_MAX = (1 << 31) - 1
INT32_MIN = -(1 << 31)
INT64_MAX = (1 << 63) - 1
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,14 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from random import seed
import unittest
from random import seed
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
class TestReciprocalOp(OpTest):
......
......@@ -15,12 +15,14 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
paddle.seed(2)
np.random.seed(2)
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.nn.functional as F
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn.functional as F
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import numpy as np
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -15,12 +15,14 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
from paddle.vision.transforms import functional as F
# paddle resize is based on cv2 module
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -13,13 +13,15 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper, run_test
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -15,12 +15,13 @@
# limitations under the License.
import numpy as np
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.nn.functional as F
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn.functional as F
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -15,12 +15,13 @@
# limitations under the License.
import numpy as np
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import numpy as np
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
def paddle_slice_assign(data, update, axes, starts, ends, strides):
assert len(axes) == len(starts) == len(ends) == len(strides)
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.nn.functional as F
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import paddle.nn.functional as F
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest
from op_test_helper import TestCaseHelper, run_test
import paddle
class TestSortOp(OpTest):
def setUp(self):
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest
from op_test_helper import TestCaseHelper
import paddle
class TestSqueezeOp(OpTest):
def setUp(self):
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper, run_test
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "x86 test will be skipped due to timeout."
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper, run_test
import paddle
@OpTestTool.skip_if(
not is_compiled_with_cuda(), "triangular solve op support GPU only now."
......
......@@ -14,13 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,12 +15,14 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import cinn
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
from op_test_helper import TestCaseHelper
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
@OpTestTool.skip_if(
......
......@@ -15,12 +15,14 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn.common import *
from cinn.frontend import *
from op_test import OpTest, OpTestTool
import paddle
import cinn
from cinn.frontend import *
from cinn.common import *
def cinn_dtype_convert(dtype_str):
......
......@@ -12,12 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from cinn.frontend import NetBuilder, Variable
from cinn.frontend import get_default_program_pass, get_default_graph_pass
import logging
import os
from test.cinn.ops.op_test import OpTest
from cinn.frontend import (
NetBuilder,
Variable,
get_default_graph_pass,
get_default_program_pass,
)
logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO').upper())
logger = logging.getLogger(name="pass_test")
......
......@@ -15,9 +15,10 @@
# limitations under the License.
import unittest
from pass_test import PassTest
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from pass_test import PassTest
class TestAutoCastPass(PassTest):
......
......@@ -15,10 +15,11 @@
# limitations under the License.
import unittest
from pass_test import PassTest
from cinn.frontend import *
from cinn.common import *
import numpy as np
from cinn.common import *
from cinn.frontend import *
from pass_test import PassTest
class TestExpandZeroDimPass(PassTest):
......
......@@ -15,9 +15,10 @@
# limitations under the License.
import unittest
from pass_test import PassTest
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from pass_test import PassTest
class TestTransposeFoldingInputPass(PassTest):
......
......@@ -15,9 +15,10 @@
# limitations under the License.
import unittest
from pass_test import PassTest
from cinn.frontend import *
from cinn.common import *
from cinn.frontend import *
from pass_test import PassTest
class TestTransposeFoldingOutputPass(PassTest):
......
......@@ -15,9 +15,10 @@
# limitations under the License.
import math
import numpy as np
import sys
import numpy as np
def pool2d(np_data, attrs, dtype="float32"):
pool_type = "max"
......
......@@ -15,11 +15,9 @@
# limitations under the License.
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn import Target
from cinn import Target, ir, lang, runtime
from cinn.common import *
......
......@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.fluid as fluid
import paddle.static as static
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle
import paddle.fluid as fluid
import paddle.static as static
assert len(sys.argv) == 3
enable_gpu = sys.argv.pop()
......
......@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import time
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
import time
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle as paddle
import paddle.fluid as fluid
enable_gpu = sys.argv.pop()
model_dir = sys.argv.pop()
......
......@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import time
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
import time
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle as paddle
import paddle.fluid as fluid
enable_gpu = sys.argv.pop()
model_dir = sys.argv.pop()
......
......@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle
import paddle.fluid as fluid
assert len(sys.argv) == 1 + 2 + 1 # model and enable_gpu count
enable_gpu = sys.argv.pop()
......
......@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from cinn.framework import *
import unittest
import numpy as np
from cinn.framework import *
class TensorTest(unittest.TestCase):
......
......@@ -15,14 +15,12 @@
# limitations under the License.
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.optim import *
from cinn import Target
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.ir import *
from cinn.optim import *
class TestIR(unittest.TestCase):
......
......@@ -15,13 +15,10 @@
# limitations under the License.
import unittest
import numpy as np
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn import Target
from cinn import utils
import numpy as np
from cinn import Target, ir, lang, runtime, utils
from cinn.poly import create_stages
......
......@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import time
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
import time
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle as paddle
import paddle.fluid as fluid
enable_gpu = sys.argv.pop()
model_dir = sys.argv.pop()
......
......@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import time
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
import time
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle as paddle
import paddle.fluid as fluid
enable_gpu = sys.argv.pop()
model_dir = sys.argv.pop()
......
......@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.static as static
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle
import paddle.static as static
enable_gpu = sys.argv.pop()
......
......@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.static as static
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle
import paddle.static as static
assert len(sys.argv) == 2
enable_gpu = sys.argv.pop()
......
......@@ -14,18 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
import logging
import math
import numpy as np
import unittest
import cinn
from cinn import frontend
from cinn import runtime
from cinn import lang
from cinn import framework
from cinn import ir
from cinn import common
import numpy as np
from cinn import common, framework, frontend, ir, lang, runtime
from cinn.poly import create_stages
import logging
from test_utils import SingleOpTester
......
......@@ -14,22 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import numpy as np
import unittest
import logging
import math
import unittest
import cinn
from cinn import frontend
from cinn import runtime
from cinn import lang
from cinn import framework
from cinn import ir
from cinn import common
import conv2d_utils
import numpy as np
import pool_utils
from cinn import common, framework, frontend, ir, lang, runtime
from cinn.poly import create_stages
import logging
from test_utils import SingleOpTester
import pool_utils
import conv2d_utils
import paddle as paddle
class OpTest_relu(SingleOpTester):
......
......@@ -14,22 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
import logging
import math
import numpy as np
import os
import unittest
import cinn
from cinn import frontend
from cinn import runtime
from cinn import lang
from cinn import framework
from cinn import ir
from cinn import common
import numpy as np
from cinn import common, framework, frontend, ir, lang, runtime
from cinn.poly import create_stages
import logging
from test_utils import SingleOpTester
import paddle
import paddle.static as static
import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
......
......@@ -15,12 +15,12 @@
# limitations under the License.
import unittest
import numpy as np
import cinn
from cinn import ir
from cinn import CINNValue
from math import isclose
import cinn
import numpy as np
from cinn import CINNValue, ir
class TestPackedFunc(unittest.TestCase):
def setUp(self):
......
......@@ -14,18 +14,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os, sys
import numpy as np
import argparse
import logging
import os
import sys
import unittest
import logging, argparse
import paddle
import numpy as np
from cinn.common import DefaultNVGPUTarget, is_compiled_with_cuda
from cinn.frontend import PaddleModelConvertor
from cinn.common import is_compiled_with_cuda, DefaultNVGPUTarget
from cinn.runtime import seed as cinn_seed
from ops.op_test import OpTestTool
from op_mappers.op_mapper_test import OpMapperTest
from ops.op_test import OpTestTool
import paddle
logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO').upper())
logger = logging.getLogger(name="paddle_model_convertor")
......
......@@ -15,16 +15,13 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn import runtime
from cinn import ir
from cinn.poly import create_stages
from cinn import lang
from cinn import Target
from cinn import pe
from cinn.common import *
import scipy
from cinn import Target, ir, lang, pe, runtime
from cinn.common import *
from cinn.poly import create_stages
from scipy import special
......
......@@ -15,13 +15,10 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn import Target
from cinn import pe
from cinn import Target, ir, lang, pe, runtime
from cinn.common import *
from cinn.poly import create_stages
......
......@@ -15,15 +15,12 @@
# limitations under the License.
import unittest
import cinn
import numpy as np
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn import Target
from cinn import pe
from cinn.poly import create_stages
from cinn import Target, ir, lang, pe, runtime
from cinn.common import *
from cinn.poly import create_stages
class TestPETransform(unittest.TestCase):
......
......@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle as paddle
import paddle.fluid as fluid
enable_gpu = sys.argv.pop()
model_dir = sys.argv.pop()
......
......@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import time
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
import time
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle as paddle
import paddle.fluid as fluid
enable_gpu = sys.argv.pop()
model_dir = sys.argv.pop()
......
......@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import time
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
import time
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle as paddle
import paddle.fluid as fluid
enable_gpu = sys.argv.pop()
model_dir = sys.argv.pop()
......
......@@ -14,20 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle as paddle
import paddle.fluid as fluid
from cinn.frontend import *
from cinn import Target
from cinn.framework import *
import sys
import time
import unittest
import cinn
from cinn import runtime
from cinn import ir
from cinn import lang
from cinn.common import *
import numpy as np
import sys
import time
from cinn import Target, ir, lang, runtime
from cinn.common import *
from cinn.framework import *
from cinn.frontend import *
import paddle as paddle
import paddle.fluid as fluid
enable_gpu = sys.argv.pop()
model_dir = sys.argv.pop()
......
......@@ -14,18 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
import logging
import math
import numpy as np
import unittest
import cinn
from cinn import frontend
from cinn import runtime
from cinn import lang
from cinn import framework
from cinn import ir
from cinn import common
import numpy as np
from cinn import common, framework, frontend, ir, lang, runtime
from cinn.poly import create_stages
import logging
class SingleOpTester(unittest.TestCase):
......
......@@ -23,9 +23,9 @@ This script helps to extract the tutorial content from a C++ source file.
# - @ROC, the code block inside a C++ multi-line string guard `ROC()ROC`,
# display as a markdown code block.
import logging
import sys
from typing import List
import logging
class Markdown(object):
......
......@@ -12,9 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
import numpy
import sys, os
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.static as static
......
......@@ -14,10 +14,11 @@
import argparse
import time
import numpy as np
from paddle.fluid.core import AnalysisConfig
from paddle.fluid.core import create_paddle_predictor
import paddle.inference as paddle_infer
from paddle.fluid.core import AnalysisConfig, create_paddle_predictor
def main():
......
......@@ -12,15 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys, os
import argparse
import os
import sys
import time
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.static as static
import time
import argparse
from paddle.fluid.core import AnalysisConfig
from paddle.fluid.core import create_paddle_predictor
from paddle.fluid.core import AnalysisConfig, create_paddle_predictor
def set_config(op_name, input_shapes, enable_gpu=False):
......
......@@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import timeit
import numpy
import tvm
import tvm.testing
from tvm import te
import numpy
import timeit
from tvm.contrib import tar, ndk
import os
from tvm import topi
from tvm import te, topi
from tvm.contrib import ndk, tar
dtype = ["float32", "float32", "float32", "float32"]
target = "llvm"
......
......@@ -15,15 +15,12 @@
import os
import numpy as np
import tvm
from tvm import te
from tvm import autotvm
from tvm import relay
import tvm.contrib.graph_runtime as runtime
import tvm.relay.testing
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner
from tvm import autotvm, relay, te
from tvm.autotvm.tuner import GATuner, GridSearchTuner, RandomTuner, XGBTuner
from tvm.contrib.utils import tempdir
import tvm.contrib.graph_runtime as runtime
# To test different ops, change this single-op network.
# See https://github.com/apache/incubator-tvm/blob/main/docs/langref/relay_op.rst to get the op list.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册