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