diff --git a/pyproject.toml b/pyproject.toml index ac34fef75fd619295a1b8b4d36255b378f17fc11..6ab8c3fd1dfa0f4c19b198ce7b1f0774ce89df5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,8 +103,5 @@ ignore = [ "F403", ] "test/cinn/**" = [ - "F401", "F403", - "F632", - "F811", ] diff --git a/test/cinn/auto_schedule/cost_model/test_cost_model.py b/test/cinn/auto_schedule/cost_model/test_cost_model.py index 76ed6e2fedade7ee66254dd44aa8b1d8e1b2b186..12db8f8ccbe10c448e10778b02c0cdb662075001 100644 --- a/test/cinn/auto_schedule/cost_model/test_cost_model.py +++ b/test/cinn/auto_schedule/cost_model/test_cost_model.py @@ -16,7 +16,6 @@ import os import shutil import unittest -import cinn import numpy as np from cinn.auto_schedule.cost_model import CostModel diff --git a/test/cinn/fake_model/naive_mul.py b/test/cinn/fake_model/naive_mul.py index 0452f41a16c6bf48d97599d91968362a14a5b7bb..5601613a6b0e4dde8fcd03bf140860efc2bf6679 100644 --- a/test/cinn/fake_model/naive_mul.py +++ b/test/cinn/fake_model/naive_mul.py @@ -12,11 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys - -import numpy -import numpy as np import paddle from paddle import fluid, static diff --git a/test/cinn/fake_model/naive_multi_fc.py b/test/cinn/fake_model/naive_multi_fc.py index 7d7995bbb256d964f70c101d10450e7a77a38d96..2d417a428fa37fce4787841c31efe2d37c20a15e 100644 --- a/test/cinn/fake_model/naive_multi_fc.py +++ b/test/cinn/fake_model/naive_multi_fc.py @@ -14,11 +14,7 @@ """ A fake model with multiple FC layers to test CINN on a more complex model. """ -import os -import sys -import numpy -import numpy as np import paddle from paddle import fluid, static diff --git a/test/cinn/fake_model/resnet_model.py b/test/cinn/fake_model/resnet_model.py index aa18fa493610604aad02dd38d7052467eb3e18ec..6871d03a9ae57b4444910591226d8282bb41e414 100644 --- a/test/cinn/fake_model/resnet_model.py +++ b/test/cinn/fake_model/resnet_model.py @@ -12,11 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys - -import numpy -import numpy as np import paddle from paddle import fluid, static diff --git a/test/cinn/op_mappers/op_mapper_test.py b/test/cinn/op_mappers/op_mapper_test.py index 978fc132dc652932ab478c75c9ccd92da95bfbc8..2e277bd879b788092850d4bcf83dd0edca87e216 100644 --- a/test/cinn/op_mappers/op_mapper_test.py +++ b/test/cinn/op_mappers/op_mapper_test.py @@ -17,18 +17,17 @@ import logging import os import sys -from ast import arg from cinn.common import is_compiled_with_cuda from cinn.framework import Scope -from cinn.frontend import NetBuilder, PaddleModelConvertor +from cinn.frontend import PaddleModelConvertor import paddle from paddle.fluid.layer_helper import LayerHelper from paddle.static import Variable as PaddleVariable sys.path.append("/work/dev_CINN/build/python/tests") -from test.cinn.ops.op_test import OpTest, OpTestTool +from test.cinn.ops.op_test import OpTest logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO').upper()) logger = logging.getLogger(name="op_test") diff --git a/test/cinn/op_mappers/test_argsort_op.py b/test/cinn/op_mappers/test_argsort_op.py index a4aad29a4c6eb6df517d9d357009d14f88b8a3c6..492f97307df7d78f605d2c796672636e376e61d9 100644 --- a/test/cinn/op_mappers/test_argsort_op.py +++ b/test/cinn/op_mappers/test_argsort_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_assign_value_op.py b/test/cinn/op_mappers/test_assign_value_op.py index a185cedbe55441f80b7eaa8095b3b3934c31cd4c..b5d8f4ceb33ace0f4154d9955a42281e299e570f 100644 --- a/test/cinn/op_mappers/test_assign_value_op.py +++ b/test/cinn/op_mappers/test_assign_value_op.py @@ -17,9 +17,7 @@ import unittest import numpy as np -from op_mapper_test import OpMapperTest, logger - -import paddle +from op_mapper_test import OpMapperTest class TestAssignValueOp(OpMapperTest): diff --git a/test/cinn/op_mappers/test_atan2_op.py b/test/cinn/op_mappers/test_atan2_op.py index 65e635c349b71bcfaa6c2a8328044c87580b7691..1f18eb71414ffaf27823a293b32cf37e712541b6 100644 --- a/test/cinn/op_mappers/test_atan2_op.py +++ b/test/cinn/op_mappers/test_atan2_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_batch_norm_op.py b/test/cinn/op_mappers/test_batch_norm_op.py index 88490102c2305d05fcaecfbd89ade151b91447f5..f4496e2126503465a3cf35c503e559e4397db4da 100644 --- a/test/cinn/op_mappers/test_batch_norm_op.py +++ b/test/cinn/op_mappers/test_batch_norm_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_bitwise_op.py b/test/cinn/op_mappers/test_bitwise_op.py index 309fcf9a629113f456a19fb92f53a3262c7d873a..2ad1df4178b2e62b082c653bcd046e32fbec6cfd 100644 --- a/test/cinn/op_mappers/test_bitwise_op.py +++ b/test/cinn/op_mappers/test_bitwise_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_compare_op.py b/test/cinn/op_mappers/test_compare_op.py index 5a30a5e9a57a240316ed205fabdf629c860738cd..7f13dfbb1da4eadbc16bec40d10cbfaf08604dd9 100644 --- a/test/cinn/op_mappers/test_compare_op.py +++ b/test/cinn/op_mappers/test_compare_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_conv2d_op.py b/test/cinn/op_mappers/test_conv2d_op.py index 15466b8160ecfbde5decbfd6d6b222415faae551..476edea445693beccd87654cd433216d4bd6e865 100644 --- a/test/cinn/op_mappers/test_conv2d_op.py +++ b/test/cinn/op_mappers/test_conv2d_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_cumsum_op.py b/test/cinn/op_mappers/test_cumsum_op.py index ec817f86f2a5ff94213a01e65b7fe919f10ea495..8245f7aa1b85cc28434502cca86e9dca37cbe295 100644 --- a/test/cinn/op_mappers/test_cumsum_op.py +++ b/test/cinn/op_mappers/test_cumsum_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_elementwise_op.py b/test/cinn/op_mappers/test_elementwise_op.py index b021dbcce8c6292b29ed1d15f163d7e8cd5b1e57..4d019678c14e6a9f6e2ae4c2750cb08d6bad74dc 100644 --- a/test/cinn/op_mappers/test_elementwise_op.py +++ b/test/cinn/op_mappers/test_elementwise_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_expand_op.py b/test/cinn/op_mappers/test_expand_op.py index 59f917fcb75d6137e30d84e3d864b3a4cd9bd0cd..f563cf62fcaf513c3591cd16bc040a0fe113a179 100644 --- a/test/cinn/op_mappers/test_expand_op.py +++ b/test/cinn/op_mappers/test_expand_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_expand_v2_op.py b/test/cinn/op_mappers/test_expand_v2_op.py index d82cb80a308360cbfcff07811759a57504fb0a69..13e8af2eba68215efc3d0190a06efdcada8fdd09 100644 --- a/test/cinn/op_mappers/test_expand_v2_op.py +++ b/test/cinn/op_mappers/test_expand_v2_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_fill_constant_op.py b/test/cinn/op_mappers/test_fill_constant_op.py index fb083e8644085341d0c2c7ee7db568de179bb5d3..69d71441d274118df3f70459bcee7e7bbee8343c 100644 --- a/test/cinn/op_mappers/test_fill_constant_op.py +++ b/test/cinn/op_mappers/test_fill_constant_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_gather_nd_op.py b/test/cinn/op_mappers/test_gather_nd_op.py index ee3458cd89dfd9f06d1506fb5fb100eefc14c549..f0e68a4a926b67b253254c605dd33d2118ef892f 100644 --- a/test/cinn/op_mappers/test_gather_nd_op.py +++ b/test/cinn/op_mappers/test_gather_nd_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_gather_op.py b/test/cinn/op_mappers/test_gather_op.py index 631d155b07e767f75d33d671e6bd4d0f16e9934a..e4c156a2becd5611030501010c5677db4ba456bb 100644 --- a/test/cinn/op_mappers/test_gather_op.py +++ b/test/cinn/op_mappers/test_gather_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_gaussian_random_op.py b/test/cinn/op_mappers/test_gaussian_random_op.py index ebd02eeb1d16551b76254b508bde83c4635eedcc..de3b64e7ecb7af2a9d9a3a218a70f88fa1e0534e 100644 --- a/test/cinn/op_mappers/test_gaussian_random_op.py +++ b/test/cinn/op_mappers/test_gaussian_random_op.py @@ -16,10 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger - -import paddle +from op_mapper_test import OpMapperTest class TestGaussianRandomOp(OpMapperTest): diff --git a/test/cinn/op_mappers/test_layer_norm_op.py b/test/cinn/op_mappers/test_layer_norm_op.py index 98f8549da81f4599d0261d0eee23268c7529250a..6a8c9451bad2ce6a3d7d9468c7259e5845b310d3 100644 --- a/test/cinn/op_mappers/test_layer_norm_op.py +++ b/test/cinn/op_mappers/test_layer_norm_op.py @@ -14,11 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import functools import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_log1p_op.py b/test/cinn/op_mappers/test_log1p_op.py index 9ed8a830b19ab2e7e670a18f0376dfb858db9637..c59bcbc8aa87edbb8dc514470213439968df0d3f 100644 --- a/test/cinn/op_mappers/test_log1p_op.py +++ b/test/cinn/op_mappers/test_log1p_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_logical_op.py b/test/cinn/op_mappers/test_logical_op.py index 9b0f95b4d3c746e0f949b4d96587d86cde8070ec..524dd982827ab8507c7681468182c668b6a02e2d 100644 --- a/test/cinn/op_mappers/test_logical_op.py +++ b/test/cinn/op_mappers/test_logical_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_lookup_table_op.py b/test/cinn/op_mappers/test_lookup_table_op.py index bbeac7a6cf3e53ce9939fe0493f413274b60e6ab..0d3f898df2a3c61bf97872cfb15a4dff13569e9d 100644 --- a/test/cinn/op_mappers/test_lookup_table_op.py +++ b/test/cinn/op_mappers/test_lookup_table_op.py @@ -14,8 +14,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_mul_op.py b/test/cinn/op_mappers/test_mul_op.py index 2a35177e8748a884faba986ba310f6d5aa7ff5ca..8726efc5aebfc3e28a40c05c285ba1b35714a657 100644 --- a/test/cinn/op_mappers/test_mul_op.py +++ b/test/cinn/op_mappers/test_mul_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_norm_op.py b/test/cinn/op_mappers/test_norm_op.py index d48ba95d32566b7b98ca7e59356fb0f13024a67d..a163925f2bc6332e08a39522e943ce5536202af2 100644 --- a/test/cinn/op_mappers/test_norm_op.py +++ b/test/cinn/op_mappers/test_norm_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_one_hot_op.py b/test/cinn/op_mappers/test_one_hot_op.py index c323e138f7b69ecba06d537e877c3696ed923236..2735af7e699a73d62e4ac7caf7792fe2f64de50f 100644 --- a/test/cinn/op_mappers/test_one_hot_op.py +++ b/test/cinn/op_mappers/test_one_hot_op.py @@ -14,8 +14,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_pow_op.py b/test/cinn/op_mappers/test_pow_op.py index b60727d746c943489e0ac6e0232a6ba644d5764f..ea30319491a42c67892f406788b512ed723c7315 100644 --- a/test/cinn/op_mappers/test_pow_op.py +++ b/test/cinn/op_mappers/test_pow_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_randint_op.py b/test/cinn/op_mappers/test_randint_op.py index e626e29a213a23b73280be94b10eaa0ba16acc03..f2e874177796cc4ff8eef47b6996c567eef07f42 100644 --- a/test/cinn/op_mappers/test_randint_op.py +++ b/test/cinn/op_mappers/test_randint_op.py @@ -16,10 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger - -import paddle +from op_mapper_test import OpMapperTest class TestRandIntOp(OpMapperTest): diff --git a/test/cinn/op_mappers/test_reduce_op.py b/test/cinn/op_mappers/test_reduce_op.py index 3a1d47389296e2627f2bc58cdf853f512e3bad14..a39acd8c16318f6aa1f53007617e922aafe71c45 100644 --- a/test/cinn/op_mappers/test_reduce_op.py +++ b/test/cinn/op_mappers/test_reduce_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_roll_op.py b/test/cinn/op_mappers/test_roll_op.py index 6eaa6bf054ab2ab05785ecaf0030455249e32e3a..a90942fed8e1a169f9c0ea960e7b462565b2ae55 100644 --- a/test/cinn/op_mappers/test_roll_op.py +++ b/test/cinn/op_mappers/test_roll_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_scale_op.py b/test/cinn/op_mappers/test_scale_op.py index d15c1ff4e280a38429abddf9625bd3a92bddcb7c..9f029ae3fafd326dfd30a7138df448b9cbb16544 100644 --- a/test/cinn/op_mappers/test_scale_op.py +++ b/test/cinn/op_mappers/test_scale_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_sign_op.py b/test/cinn/op_mappers/test_sign_op.py index c732aaaa229d0488962e5c112c4a077ae9a8e67f..cb1995f6f9b9a97c4998569d5911180c2720ef9d 100644 --- a/test/cinn/op_mappers/test_sign_op.py +++ b/test/cinn/op_mappers/test_sign_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_split_op.py b/test/cinn/op_mappers/test_split_op.py index e73f1302ee68b1245986660b8a809a2e4192d14e..2f82ea5f33b7b4a8a227f9dff29371e063c06f48 100644 --- a/test/cinn/op_mappers/test_split_op.py +++ b/test/cinn/op_mappers/test_split_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_squeeze_op.py b/test/cinn/op_mappers/test_squeeze_op.py index 7acb33c029af5f0855a09f1954539f16b5e4ac56..1381101242eaf3ff49391114d5fdb9a326e26a9c 100644 --- a/test/cinn/op_mappers/test_squeeze_op.py +++ b/test/cinn/op_mappers/test_squeeze_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_stack_op.py b/test/cinn/op_mappers/test_stack_op.py index 06cb4bf6e7b208f420ad0477c37d44f078c7f21d..1592476c9a046676a3ea424502f8368f77b1d7fe 100644 --- a/test/cinn/op_mappers/test_stack_op.py +++ b/test/cinn/op_mappers/test_stack_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_strided_slice_op.py b/test/cinn/op_mappers/test_strided_slice_op.py index 2f1fb248ad8b593a32f5fda10149f697e02ea60b..598944e9279e945a4a60cf59118f353ee5e89826 100644 --- a/test/cinn/op_mappers/test_strided_slice_op.py +++ b/test/cinn/op_mappers/test_strided_slice_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_tile_op.py b/test/cinn/op_mappers/test_tile_op.py index 75b04947a0ee313945045e744dfc1e5800418703..fc40359de57501e6589c06867cc8636fc54d8a1a 100644 --- a/test/cinn/op_mappers/test_tile_op.py +++ b/test/cinn/op_mappers/test_tile_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_transpose2_op.py b/test/cinn/op_mappers/test_transpose2_op.py index 6b47934a3ba4329bd2c1f29e5a6c645703046ebb..12e6ccca722f1383e3ee178a749782edb1aa9d19 100644 --- a/test/cinn/op_mappers/test_transpose2_op.py +++ b/test/cinn/op_mappers/test_transpose2_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_unary_op.py b/test/cinn/op_mappers/test_unary_op.py index b6b5fb8bf11cfb67122a9726ded6c59999c23c7f..0d019d679fc669cc428b11ed48e9ea6fe01800d3 100644 --- a/test/cinn/op_mappers/test_unary_op.py +++ b/test/cinn/op_mappers/test_unary_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_uniform_random_op.py b/test/cinn/op_mappers/test_uniform_random_op.py index f4fd37b7182c1134ac5ae5b656e9f9a7afaf7085..fae8b61956bbf1eea0836238a620cb1c09370a4c 100644 --- a/test/cinn/op_mappers/test_uniform_random_op.py +++ b/test/cinn/op_mappers/test_uniform_random_op.py @@ -16,10 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger - -import paddle +from op_mapper_test import OpMapperTest class TestUniformRandomOp(OpMapperTest): diff --git a/test/cinn/op_mappers/test_where_op.py b/test/cinn/op_mappers/test_where_op.py index 4398e9e6af9bb5bbeb05d987506776990225872f..766470ff5732fd3446ea091ea1850910163b7930 100644 --- a/test/cinn/op_mappers/test_where_op.py +++ b/test/cinn/op_mappers/test_where_op.py @@ -16,8 +16,7 @@ import unittest -import numpy as np -from op_mapper_test import OpMapperTest, logger +from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/ops/op_test.py b/test/cinn/ops/op_test.py index d0952caef29ca19823ef4783846c7116f93d42ab..02071655bd6fd2b1616df8d0bfa0f87dd1b4e98f 100755 --- a/test/cinn/ops/op_test.py +++ b/test/cinn/ops/op_test.py @@ -16,10 +16,8 @@ import logging import os import struct import unittest -from contextlib import contextmanager import numpy as np -from cinn import Target from cinn.common import * from cinn.frontend import * from cinn.runtime import seed as cinn_seed diff --git a/test/cinn/ops/test_abs_op.py b/test/cinn/ops/test_abs_op.py index 10f12c2b9e7df23fe95ed562cb98dd1f1ede373d..e5f1dfee23458a2b7ebb27a120b85de165bca477 100644 --- a/test/cinn/ops/test_abs_op.py +++ b/test/cinn/ops/test_abs_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_acos_op.py b/test/cinn/ops/test_acos_op.py index afb692c6d8a2a577a7fed861da6f414ea85a501c..637d4eb7b171ce06731f51c93da1385367616a50 100644 --- a/test/cinn/ops/test_acos_op.py +++ b/test/cinn/ops/test_acos_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_acosh_op.py b/test/cinn/ops/test_acosh_op.py index 0e3cd2b33008f0dbed9435ac8a084e2ad0e5f788..2d87221f141c489d420071c4572fcf491679ae7d 100644 --- a/test/cinn/ops/test_acosh_op.py +++ b/test/cinn/ops/test_acosh_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_asin_op.py b/test/cinn/ops/test_asin_op.py index 11426a57e8a0f18bdacb49ce2a0bccbde37a2ca0..691efd004b932110f873d87d86b356776d439f79 100644 --- a/test/cinn/ops/test_asin_op.py +++ b/test/cinn/ops/test_asin_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_asinh_op.py b/test/cinn/ops/test_asinh_op.py index 7622c34d08514920f0fa42c2258582920ea6c7b8..565ba8627ae3cdcc6fc859599ad2b0ec67c4e37e 100644 --- a/test/cinn/ops/test_asinh_op.py +++ b/test/cinn/ops/test_asinh_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_atan_op.py b/test/cinn/ops/test_atan_op.py index 81574ebe20a2d8b3e279659ff6c8fb4c7526f237..6b3a832407e95269354425d7ae5ba0544e16d43b 100644 --- a/test/cinn/ops/test_atan_op.py +++ b/test/cinn/ops/test_atan_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_atanh_op.py b/test/cinn/ops/test_atanh_op.py index b53fee7a96ac187188baec24e607fe17e3d5d119..a7d92572acc3287afbdb7245bfb8d4a44a2d5963 100644 --- a/test/cinn/ops/test_atanh_op.py +++ b/test/cinn/ops/test_atanh_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_batch_norm_op.py b/test/cinn/ops/test_batch_norm_op.py index 8c57a9cd88df5873c662ff3e412c470ff5126eb8..052352f810f89cbf56405ec754fd929ad5213cf0 100644 --- a/test/cinn/ops/test_batch_norm_op.py +++ b/test/cinn/ops/test_batch_norm_op.py @@ -14,11 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_binary_elementwise_op.py b/test/cinn/ops/test_binary_elementwise_op.py index 045785982fc67b938c995d66d1d81c65262b58b9..475ca5c1825a2322d2b60af9a333f9f8f1f26327 100644 --- a/test/cinn/ops/test_binary_elementwise_op.py +++ b/test/cinn/ops/test_binary_elementwise_op.py @@ -16,7 +16,6 @@ import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_bitcast_convert_op.py b/test/cinn/ops/test_bitcast_convert_op.py index 30af48b8a24ebcb38e6d699caa55c586927f336c..8a5c7b0c2c00ce7d6589a07cbcf2316d655ac169 100644 --- a/test/cinn/ops/test_bitcast_convert_op.py +++ b/test/cinn/ops/test_bitcast_convert_op.py @@ -15,7 +15,6 @@ import unittest from struct import pack, unpack -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_broadcast_to_op.py b/test/cinn/ops/test_broadcast_to_op.py index 3536355ac69e64dff37df13290b557c9825aae3b..550209d05cec4486a90345a493bc8cb55a36a17b 100644 --- a/test/cinn/ops/test_broadcast_to_op.py +++ b/test/cinn/ops/test_broadcast_to_op.py @@ -14,14 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * -from op_test import OpTest, OpTestTool +from op_test import OpTest import paddle diff --git a/test/cinn/ops/test_cast_op.py b/test/cinn/ops/test_cast_op.py index 99a4a4f86301d30d2bebe9015a645cd6510b3677..e2b4dfa8f66948eecd587a003d19d012344f2fa7 100644 --- a/test/cinn/ops/test_cast_op.py +++ b/test/cinn/ops/test_cast_op.py @@ -14,10 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_conv2d_op.py b/test/cinn/ops/test_conv2d_op.py index a9a83c101cf5208ff61090e6d214612756df107c..4ce19366482aac6dc721bd9e09b427d4d96cdee1 100755 --- a/test/cinn/ops/test_conv2d_op.py +++ b/test/cinn/ops/test_conv2d_op.py @@ -13,10 +13,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from cinn.runtime import * diff --git a/test/cinn/ops/test_cos_op.py b/test/cinn/ops/test_cos_op.py index eef3c2d05ead012e63286bf041be24173c5a7d16..831247cca573377268dc90ea0366419242c19a1d 100644 --- a/test/cinn/ops/test_cos_op.py +++ b/test/cinn/ops/test_cos_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_cosh_op.py b/test/cinn/ops/test_cosh_op.py index 672af4fca0a518452e0cdcf583a9139a1bcfb19b..f4c823265ff6052f3af72e4cd0c19c1826d26a49 100644 --- a/test/cinn/ops/test_cosh_op.py +++ b/test/cinn/ops/test_cosh_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_depthwise_conv2d_op.py b/test/cinn/ops/test_depthwise_conv2d_op.py index 2819ed30fa5fe047b0bef7dd4cc0fd56d4dfd75d..a0ead5faeec994e241cbf5f5e8f3023b173fba05 100644 --- a/test/cinn/ops/test_depthwise_conv2d_op.py +++ b/test/cinn/ops/test_depthwise_conv2d_op.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_divide_op.py b/test/cinn/ops/test_divide_op.py index 3dc8cf74f0e4be01aeb90cbd261be1a3e72447cb..be1415c7f84611f8975057e9bd73a8b8a179007c 100644 --- a/test/cinn/ops/test_divide_op.py +++ b/test/cinn/ops/test_divide_op.py @@ -45,7 +45,7 @@ class TestDivOp(OpTest): ) # paddle.divide does not support zero division - if self.case["y_dtype"] is "int32" or self.case["y_dtype"] is "int64": + if self.case["y_dtype"] == "int32" or self.case["y_dtype"] == "int64": self.y_np[self.y_np == 0] = 1 def build_paddle_program(self, target): diff --git a/test/cinn/ops/test_dropout_infer_op.py b/test/cinn/ops/test_dropout_infer_op.py index b9bc5d9680bc4de7ea55657169aa1f2b2381e46d..19b54e9f39b0014b97ea09127d3975fc27e28e59 100644 --- a/test/cinn/ops/test_dropout_infer_op.py +++ b/test/cinn/ops/test_dropout_infer_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool @@ -40,9 +37,9 @@ class TestDropoutInferOp(OpTest): self.x_np = self.random( shape=self.case["x_shape"], dtype=self.case["x_dtype"] ) - if self.case["mode"] is 'upscale_in_train': + if self.case["mode"] == 'upscale_in_train': self.case["cinn_mode"] = 'upscale_in_train' - elif self.case["mode"] is 'downscale_in_infer': + elif self.case["mode"] == 'downscale_in_infer': self.case["cinn_mode"] = 'downgrade_in_infer' else: raise f"Unknown mode for dropout_infer: {self.case['mode']}" diff --git a/test/cinn/ops/test_erf_op.py b/test/cinn/ops/test_erf_op.py index 860c1a17de8cb3390c0c33477bc835a783e63315..4b84570bd59f4f93985d61eccd54832ca2093f00 100644 --- a/test/cinn/ops/test_erf_op.py +++ b/test/cinn/ops/test_erf_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_exp_op.py b/test/cinn/ops/test_exp_op.py index f25577d28681ab16005ea20cf4ffe64085e240c0..3d378579a8a48ca49f3bd15269e7d30572324b36 100644 --- a/test/cinn/ops/test_exp_op.py +++ b/test/cinn/ops/test_exp_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_floor_divide_op.py b/test/cinn/ops/test_floor_divide_op.py index bef6dba1455e3efb72f880d4f64ddf1954c9f1a9..a14458630592acd364b8f7327b506ff16dbe3340 100644 --- a/test/cinn/ops/test_floor_divide_op.py +++ b/test/cinn/ops/test_floor_divide_op.py @@ -14,17 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper import paddle -import paddle.nn.functional as F @OpTestTool.skip_if( diff --git a/test/cinn/ops/test_floor_op.py b/test/cinn/ops/test_floor_op.py index 24bbbab3bf26babdd15a4f9413508de3295c1f2d..47b68e95e1242dba1a49f961907fe8d874f46440 100644 --- a/test/cinn/ops/test_floor_op.py +++ b/test/cinn/ops/test_floor_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_gather_nd_op.py b/test/cinn/ops/test_gather_nd_op.py index 477a03f2807499e986a04ca070d43d77e07af071..60e0e71675aa52c17a5252a949ff3c6b0dcaaa92 100644 --- a/test/cinn/ops/test_gather_nd_op.py +++ b/test/cinn/ops/test_gather_nd_op.py @@ -19,7 +19,6 @@ import os import unittest from itertools import product -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_gather_op.py b/test/cinn/ops/test_gather_op.py index c0bb83f20ede9ca13ba6be073cc128cf483c6ba4..14658e756cef015a70b16af1a46c1c8f345b218b 100644 --- a/test/cinn/ops/test_gather_op.py +++ b/test/cinn/ops/test_gather_op.py @@ -16,10 +16,7 @@ import logging import os -import unittest -from itertools import product -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_gaussian_random_op.py b/test/cinn/ops/test_gaussian_random_op.py index f62835ae811789c2650108356b02ea5f239e5e73..10677ca62fd6d5a82ad88b0db7c6cc5826a3ea2d 100644 --- a/test/cinn/ops/test_gaussian_random_op.py +++ b/test/cinn/ops/test_gaussian_random_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_gelu_op.py b/test/cinn/ops/test_gelu_op.py index cd5971925debe2afd64a8b588a381bd232e1567a..df50c85ded8ffc69f9e81de6ffef35ac74202224 100644 --- a/test/cinn/ops/test_gelu_op.py +++ b/test/cinn/ops/test_gelu_op.py @@ -14,10 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_identity_op.py b/test/cinn/ops/test_identity_op.py index 683625506dbc49ab10dddec717e4d1195a54a2d3..dbf595a9222962e801788d9c825c2d80667f63e0 100644 --- a/test/cinn/ops/test_identity_op.py +++ b/test/cinn/ops/test_identity_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_is_finite_op.py b/test/cinn/ops/test_is_finite_op.py index 12d64a0050f69e1a9602a75bf107a55c0b39a579..a7a94de1f4d256f93c01a03c12a4ad4279e868fa 100644 --- a/test/cinn/ops/test_is_finite_op.py +++ b/test/cinn/ops/test_is_finite_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import numpy as np from cinn.common import * diff --git a/test/cinn/ops/test_is_inf_op.py b/test/cinn/ops/test_is_inf_op.py index ad3248e2998885d66647ca93f41b0647c50d4dae..90ea69e4cc958d58e29a04484a69844dba8afe96 100644 --- a/test/cinn/ops/test_is_inf_op.py +++ b/test/cinn/ops/test_is_inf_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import numpy as np from cinn.common import * diff --git a/test/cinn/ops/test_is_nan_op.py b/test/cinn/ops/test_is_nan_op.py index bd0dfaa70ee05ca877a39aea8e8831704166ee24..8ebe3bda8ef06bc1aedbb15f7a2fb4b1e519af64 100644 --- a/test/cinn/ops/test_is_nan_op.py +++ b/test/cinn/ops/test_is_nan_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import numpy as np from cinn.common import * diff --git a/test/cinn/ops/test_isclose_op.py b/test/cinn/ops/test_isclose_op.py index 73bf8a7f6492e40e9961bebcfec9bbc0d233a676..897a06c0f3e5d201cbbff28ebc83841d9beb8732 100644 --- a/test/cinn/ops/test_isclose_op.py +++ b/test/cinn/ops/test_isclose_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_left_shift_op.py b/test/cinn/ops/test_left_shift_op.py index 57eb693dbced7ed9ee594f87cbdd7ba8722630ca..28f5b69853b4b3d23d10ee82c874bd6d8f30503e 100644 --- a/test/cinn/ops/test_left_shift_op.py +++ b/test/cinn/ops/test_left_shift_op.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_log_op.py b/test/cinn/ops/test_log_op.py index bb66e71f1b8dd7aa6dd4f10d40770df62fd75f17..f2868b6f46dd9fb5b3eb3f79d8585a31014d9ad1 100644 --- a/test/cinn/ops/test_log_op.py +++ b/test/cinn/ops/test_log_op.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn from cinn.common import * from cinn.frontend import * from op_test import OpTest diff --git a/test/cinn/ops/test_logical_and_op.py b/test/cinn/ops/test_logical_and_op.py index b7fcf7c5461555169cd267cf7e10f318f2140de5..dfb8cc18b306db911617be59177a3b700fc9e516 100644 --- a/test/cinn/ops/test_logical_and_op.py +++ b/test/cinn/ops/test_logical_and_op.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_logical_not_op.py b/test/cinn/ops/test_logical_not_op.py index 1e04ac6eaee96eb2b08584647a143bbe18fd42cc..d2fe5733fc89b1b530be284acdcd5b6381820b50 100644 --- a/test/cinn/ops/test_logical_not_op.py +++ b/test/cinn/ops/test_logical_not_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_logical_or_op.py b/test/cinn/ops/test_logical_or_op.py index 0b7344d53be8f363d9017fe596e1a9ddcfdef279..594eced153d83b79d79009c6448c05c558eaccaf 100644 --- a/test/cinn/ops/test_logical_or_op.py +++ b/test/cinn/ops/test_logical_or_op.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_logical_right_shift_op.py b/test/cinn/ops/test_logical_right_shift_op.py index 52500698b8c703c49bbd2ffd05c3759ddd000860..8651d505613f216cdaa5570defaf6beb0c1b5b3c 100644 --- a/test/cinn/ops/test_logical_right_shift_op.py +++ b/test/cinn/ops/test_logical_right_shift_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_logical_xor_op.py b/test/cinn/ops/test_logical_xor_op.py index b216c6a7a7d77771ad374a0fb9995625cd659fa1..629a5e68e175267394c74f0eee74effbc58b188d 100644 --- a/test/cinn/ops/test_logical_xor_op.py +++ b/test/cinn/ops/test_logical_xor_op.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_lookup_table_op.py b/test/cinn/ops/test_lookup_table_op.py index 21eec9de763309880cfd2cf38ed8ebfa6bf9087c..e1516e8235818f20b6217afa21ae01c60ec9ba53 100644 --- a/test/cinn/ops/test_lookup_table_op.py +++ b/test/cinn/ops/test_lookup_table_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_matmul_op.py b/test/cinn/ops/test_matmul_op.py index a2fd15232668765461b88bc1250763f355adeaa6..f47e96e0278370509f86dbde23b410e5b94194d5 100755 --- a/test/cinn/ops/test_matmul_op.py +++ b/test/cinn/ops/test_matmul_op.py @@ -14,17 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper import paddle -import paddle.nn.functional as F @OpTestTool.skip_if( diff --git a/test/cinn/ops/test_mod_op.py b/test/cinn/ops/test_mod_op.py index b93e9481a3deb92c90b44124da26792be1894462..8a409b8fec629e12d24a1a8dc0c91f8ab1f09169 100644 --- a/test/cinn/ops/test_mod_op.py +++ b/test/cinn/ops/test_mod_op.py @@ -14,10 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_negative_op.py b/test/cinn/ops/test_negative_op.py index f8d8b7ecd29365c39d8b3ef13d106990eb92f760..d2de2967914606c7fbfca35ce60b0a3b9182496a 100644 --- a/test/cinn/ops/test_negative_op.py +++ b/test/cinn/ops/test_negative_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_one_hot_op.py b/test/cinn/ops/test_one_hot_op.py index 02d5f4502e112012b86d822a3fb58af29730088c..e76cee6e01dd2708b6834dcff16d5d561ab8618a 100755 --- a/test/cinn/ops/test_one_hot_op.py +++ b/test/cinn/ops/test_one_hot_op.py @@ -14,10 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_pow_op.py b/test/cinn/ops/test_pow_op.py index c02afc726764f54778c52b425ecea87efcdddd96..4728fc95b96beaa2aa6040de869165477986c1e3 100644 --- a/test/cinn/ops/test_pow_op.py +++ b/test/cinn/ops/test_pow_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_randint_op.py b/test/cinn/ops/test_randint_op.py index 4a88a8e50fe3d802f8ee09c6438241feb28bcb5a..b2102357d84951a59c9b95b388074b6542a14c1f 100644 --- a/test/cinn/ops/test_randint_op.py +++ b/test/cinn/ops/test_randint_op.py @@ -15,10 +15,7 @@ # limitations under the License. import unittest -from random import seed -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_reciprocal_op.py b/test/cinn/ops/test_reciprocal_op.py index 45679b4ec4e3f6c5a97efa47fbdd81ff54c277e7..8a8eaf2276deee1a38777f5b8c0870acb85efa47 100644 --- a/test/cinn/ops/test_reciprocal_op.py +++ b/test/cinn/ops/test_reciprocal_op.py @@ -12,13 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * -from op_test import OpTest, OpTestTool +from op_test import OpTest from op_test_helper import TestCaseHelper import paddle diff --git a/test/cinn/ops/test_reduce_op.py b/test/cinn/ops/test_reduce_op.py index fca5d31605012b51fca622fd965cbe3395276a99..238dcbf1a54014a96e9ff6f9161491d25dfd0ca9 100644 --- a/test/cinn/ops/test_reduce_op.py +++ b/test/cinn/ops/test_reduce_op.py @@ -16,7 +16,6 @@ import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_reduce_op_new.py b/test/cinn/ops/test_reduce_op_new.py index 105a56c5bc5159aad707fa157d82091da03f51d9..cb295ccff412ee2c0b071bdf313b8788882ceb90 100644 --- a/test/cinn/ops/test_reduce_op_new.py +++ b/test/cinn/ops/test_reduce_op_new.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_relu6_op.py b/test/cinn/ops/test_relu6_op.py index bb9faad7770412196204220fc6819e6bd55ec86c..41369dd15546733296116a2c309f1c8255e0a2f9 100644 --- a/test/cinn/ops/test_relu6_op.py +++ b/test/cinn/ops/test_relu6_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_remainder_op.py b/test/cinn/ops/test_remainder_op.py index dbbbca33b2754b19b4d2fc845a2e2a87571b0596..597c5bbcf6b1cc8c22160344096c42d370ce5c3b 100644 --- a/test/cinn/ops/test_remainder_op.py +++ b/test/cinn/ops/test_remainder_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_resize_op.py b/test/cinn/ops/test_resize_op.py index dd3ab475d046f779d601ce4d15b647e25f26d0fa..9c6118cdb47c9dfb5c791a1b2629d42925bd5efa 100644 --- a/test/cinn/ops/test_resize_op.py +++ b/test/cinn/ops/test_resize_op.py @@ -14,16 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * -from op_test import OpTest, OpTestTool - -import paddle -from paddle.vision.transforms import functional as F # paddle resize is based on cv2 module # This test requires cv2 module (pip3.6 install opencv_python==3.2.0.7) diff --git a/test/cinn/ops/test_right_shift_op.py b/test/cinn/ops/test_right_shift_op.py index e4ac9a2fb403b658aeffd93fe66f96ba8bca2e9d..400d82110d19890ef0b63e525a12f8e2350d3347 100644 --- a/test/cinn/ops/test_right_shift_op.py +++ b/test/cinn/ops/test_right_shift_op.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_round_op.py b/test/cinn/ops/test_round_op.py index 0da35d93d4d669a4d2c811bb35f4dc14c36a6547..dab3ef16775aabf78e6390548cfe15d7fd696871 100644 --- a/test/cinn/ops/test_round_op.py +++ b/test/cinn/ops/test_round_op.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_rsqrt_op.py b/test/cinn/ops/test_rsqrt_op.py index 8c1c13937eb2888ba1993f757d7d327347c19bbc..c48ebc92aa8cd99359a27be0eb3fa8dc4857be59 100644 --- a/test/cinn/ops/test_rsqrt_op.py +++ b/test/cinn/ops/test_rsqrt_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_scale_op.py b/test/cinn/ops/test_scale_op.py index 35f101cd6e1f38ddf21565ccaf27145de6fc321a..577093dbaf550814e96476fa9efb5e931ee404b9 100644 --- a/test/cinn/ops/test_scale_op.py +++ b/test/cinn/ops/test_scale_op.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_sin_op.py b/test/cinn/ops/test_sin_op.py index adb0385cda04e660a3a5e9b6c61ea2e1de9b09c3..93b60714682624a46adc3972a126f532852faa10 100644 --- a/test/cinn/ops/test_sin_op.py +++ b/test/cinn/ops/test_sin_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_sinh_op.py b/test/cinn/ops/test_sinh_op.py index 66e2675d7fe5d8854deb052a5b39564189dc746f..84ad57dd8d07b548e21dd589bb17b8fb6ae9f8c7 100644 --- a/test/cinn/ops/test_sinh_op.py +++ b/test/cinn/ops/test_sinh_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_sqrt_op.py b/test/cinn/ops/test_sqrt_op.py index 670034602e131a5625289507bca049a6ec8b76a8..2af490581e6c38011e742fb28f1d4fbb027b7615 100644 --- a/test/cinn/ops/test_sqrt_op.py +++ b/test/cinn/ops/test_sqrt_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_tan_op.py b/test/cinn/ops/test_tan_op.py index 3e26841d618476faa7718f4f7b012d2cc0212601..bd43fa6ad424349581f5a52072dfc0542361acb2 100644 --- a/test/cinn/ops/test_tan_op.py +++ b/test/cinn/ops/test_tan_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_tanh_op.py b/test/cinn/ops/test_tanh_op.py index 8af25cfb4f660ef8cd63e5e96f25c058281a2ea2..15c806f89e15296926c2809b03d9ebc1962929b7 100644 --- a/test/cinn/ops/test_tanh_op.py +++ b/test/cinn/ops/test_tanh_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_trunc_op.py b/test/cinn/ops/test_trunc_op.py index 9e3d95d84d441acc2371aae37de511f6e84d0bb9..64df64d2199286e342d7db80cfd78828becef57c 100644 --- a/test/cinn/ops/test_trunc_op.py +++ b/test/cinn/ops/test_trunc_op.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn -import numpy as np from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_unary_elementwise_op.py b/test/cinn/ops/test_unary_elementwise_op.py index 40cda2d1def5d2eb0c2c5786b2302abb8d7387b4..f9207bcb3075667d1e06049e2bb5f2994001c106 100644 --- a/test/cinn/ops/test_unary_elementwise_op.py +++ b/test/cinn/ops/test_unary_elementwise_op.py @@ -16,7 +16,6 @@ import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/ops/test_uniform_random_op.py b/test/cinn/ops/test_uniform_random_op.py index 52245e3a3582f2a47f24a6e03eb41aef9fc65cdb..0cfc2de497be568d61781337341d137e8e51f522 100644 --- a/test/cinn/ops/test_uniform_random_op.py +++ b/test/cinn/ops/test_uniform_random_op.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cinn from cinn.common import * from cinn.frontend import * from op_test import OpTest, OpTestTool diff --git a/test/cinn/ops/test_zero_dim_tensor.py b/test/cinn/ops/test_zero_dim_tensor.py index 28d8cd94aaa90b3525bab7456107ec07a22a44fd..152dc0c741f67a039e9afa357dba13556fafac42 100644 --- a/test/cinn/ops/test_zero_dim_tensor.py +++ b/test/cinn/ops/test_zero_dim_tensor.py @@ -16,7 +16,6 @@ import unittest -import cinn import numpy as np from cinn.common import * from cinn.frontend import * diff --git a/test/cinn/passes/pass_test.py b/test/cinn/passes/pass_test.py index 1f047f2348be0a999e24951beeccf492b9f7fd96..099d5b2a07fecf3a39819f7738ba5b95050bf5c8 100644 --- a/test/cinn/passes/pass_test.py +++ b/test/cinn/passes/pass_test.py @@ -16,12 +16,7 @@ import logging import os from test.cinn.ops.op_test import OpTest -from cinn.frontend import ( - NetBuilder, - Variable, - get_default_graph_pass, - get_default_program_pass, -) +from cinn.frontend import NetBuilder, Variable logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO').upper()) logger = logging.getLogger(name="pass_test") diff --git a/test/cinn/test_common.py b/test/cinn/test_common.py index 61caba97f55bbdff90766da3648833f012339f75..415cab8b64a165b20ecb0a91a14ab6fedfdbf038 100644 --- a/test/cinn/test_common.py +++ b/test/cinn/test_common.py @@ -16,8 +16,6 @@ import unittest -import cinn -from cinn import Target, ir, lang, runtime from cinn.common import * diff --git a/test/cinn/test_computation.py b/test/cinn/test_computation.py index 7081749021ce5d0789be328c10426044f6622075..e09074810fd0f49a99d08be2f259104551adb08a 100755 --- a/test/cinn/test_computation.py +++ b/test/cinn/test_computation.py @@ -17,9 +17,7 @@ import sys import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * diff --git a/test/cinn/test_efficientnet.py b/test/cinn/test_efficientnet.py index 0b277ef760bb69c52faf496390c314b90768dc3f..7df10747a698365112f72067bff9c624abb3329e 100755 --- a/test/cinn/test_efficientnet.py +++ b/test/cinn/test_efficientnet.py @@ -18,14 +18,11 @@ import sys import time import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid enable_gpu = sys.argv.pop() diff --git a/test/cinn/test_facedet.py b/test/cinn/test_facedet.py index 31b7e18c5e23392a272eef80b185cdeceddb5a96..88e98cc4fb0256e953e7bd4b6ae0230557a97467 100755 --- a/test/cinn/test_facedet.py +++ b/test/cinn/test_facedet.py @@ -18,14 +18,11 @@ import sys import time import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid enable_gpu = sys.argv.pop() diff --git a/test/cinn/test_frontend.py b/test/cinn/test_frontend.py index 52196a48abc6ccd955549447426df5b05a44bc8f..9b33174e8a79a9822f58855cdf8d953029b02012 100755 --- a/test/cinn/test_frontend.py +++ b/test/cinn/test_frontend.py @@ -17,14 +17,11 @@ import sys import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid assert len(sys.argv) == 1 + 2 + 1 # model and enable_gpu count diff --git a/test/cinn/test_ir.py b/test/cinn/test_ir.py index af14f1efbcd600a5893f2feaafb4226c155f0a0b..d9dd02eea570413ff5c823b90c4061a7b615c8dc 100644 --- a/test/cinn/test_ir.py +++ b/test/cinn/test_ir.py @@ -16,8 +16,6 @@ import unittest -import cinn -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.ir import * from cinn.optim import * diff --git a/test/cinn/test_mobilenetv1.py b/test/cinn/test_mobilenetv1.py index fc49d51efb94f2e403f374daa28f5c2bc718e701..06365105fff0030ac43c64833106f46729e6d6cb 100644 --- a/test/cinn/test_mobilenetv1.py +++ b/test/cinn/test_mobilenetv1.py @@ -18,14 +18,11 @@ import sys import time import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid enable_gpu = sys.argv.pop() diff --git a/test/cinn/test_mobilenetv2.py b/test/cinn/test_mobilenetv2.py index 045c63ee7ab7c7968ebe9eb15f6905ebb1d14e7b..461bfdd630c321d552cb02e31f098ce89f27d084 100755 --- a/test/cinn/test_mobilenetv2.py +++ b/test/cinn/test_mobilenetv2.py @@ -18,14 +18,11 @@ import sys import time import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid enable_gpu = sys.argv.pop() diff --git a/test/cinn/test_netbuilder.py b/test/cinn/test_netbuilder.py index 3da2de3c6b3be1f16435c2b27383ad22e5ccfc5d..3e6a3081ed6c3b8cebd22b028cafd5634e04d3e8 100755 --- a/test/cinn/test_netbuilder.py +++ b/test/cinn/test_netbuilder.py @@ -17,9 +17,7 @@ import sys import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * diff --git a/test/cinn/test_op_benchmark.py b/test/cinn/test_op_benchmark.py index 7ab0806d87e6bf216c04521967b50fb33323ae58..1240b5134811e678a23c90bf8864029ad33fe387 100755 --- a/test/cinn/test_op_benchmark.py +++ b/test/cinn/test_op_benchmark.py @@ -17,9 +17,7 @@ import sys import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * @@ -314,7 +312,7 @@ __global__ void fn_conv2d_0_kernel(float* __restrict__ placeholder, float* __res "TESTING [mul and add] time cost with shape [128,512]*[256,512]...", ) - def atest_matmul(self): + def atest_matmul3(self): prog = Program() a = Variable("A").set_type(Float(32)).set_shape([512, 512]) b = Variable("B").set_type(Float(32)).set_shape([512, 512]) @@ -440,7 +438,7 @@ typedef char int8_t; (tensor_data[0] + tensor_data[1]).reshape(-1), result, atol=1e-4 ) - def atest_elementwise2(self): + def atest_elementwise3(self): prog = Program() a = Variable("A").set_type(Float(32)).set_shape([4, 1024]) b = Variable("B").set_type(Float(32)).set_shape([4, 1024]) diff --git a/test/cinn/test_op_broadcast.py b/test/cinn/test_op_broadcast.py index 26e8ab67bc7174f6974fdfd9f37f104e0ad5e1ce..4aa2f9fb430f831d22f1baacc2c1b92ecd2a28f6 100644 --- a/test/cinn/test_op_broadcast.py +++ b/test/cinn/test_op_broadcast.py @@ -14,14 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging -import math import unittest -import cinn -import numpy as np -from cinn import common, framework, frontend, ir, lang, runtime -from cinn.poly import create_stages +from cinn import framework from test_utils import SingleOpTester diff --git a/test/cinn/test_op_nn.py b/test/cinn/test_op_nn.py index 9535e16b647202fd0674a26053a7580694ebde2d..ed862cecfcd57bc7b7ce9e14c308928abdb438ca 100644 --- a/test/cinn/test_op_nn.py +++ b/test/cinn/test_op_nn.py @@ -14,20 +14,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import math import unittest -import cinn import conv2d_utils import numpy as np import pool_utils -from cinn import common, framework, frontend, ir, lang, runtime -from cinn.poly import create_stages +from cinn import framework from test_utils import SingleOpTester -import paddle - class OpTest_relu(SingleOpTester): def create_target_data(self, inputs_data, attrs): diff --git a/test/cinn/test_op_transform.py b/test/cinn/test_op_transform.py index 2f4958a22bbe66624cb2851dd357230c40112ab2..7da12d59e7bfc69905928ba2eff540c76cee0575 100644 --- a/test/cinn/test_op_transform.py +++ b/test/cinn/test_op_transform.py @@ -14,15 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging -import math import os import unittest -import cinn -import numpy as np -from cinn import common, framework, frontend, ir, lang, runtime -from cinn.poly import create_stages +from cinn import framework from test_utils import SingleOpTester import paddle diff --git a/test/cinn/test_packed_func.py b/test/cinn/test_packed_func.py index 4525eab37ec71e349743ce91ff7e5e2a050600db..3a833df11fd8582d539014956962b351a1ba03ec 100755 --- a/test/cinn/test_packed_func.py +++ b/test/cinn/test_packed_func.py @@ -18,8 +18,7 @@ import unittest from math import isclose import cinn -import numpy as np -from cinn import CINNValue, ir +from cinn import ir class TestPackedFunc(unittest.TestCase): diff --git a/test/cinn/test_paddle_model_convertor.py b/test/cinn/test_paddle_model_convertor.py index b0c0c55ae113624efb9442a8467b9a92515cd250..af80736f4662c1fc348632711d7470db159be8fd 100644 --- a/test/cinn/test_paddle_model_convertor.py +++ b/test/cinn/test_paddle_model_convertor.py @@ -21,15 +21,10 @@ import sys import unittest import numpy as np -from cinn.common import ( - DefaultHostTarget, - DefaultNVGPUTarget, - is_compiled_with_cuda, -) +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget from cinn.frontend import PaddleModelConvertor from cinn.runtime import seed as cinn_seed from op_mappers.op_mapper_test import OpMapperTest -from ops.op_test import OpTestTool import paddle diff --git a/test/cinn/test_pe_elementwise.py b/test/cinn/test_pe_elementwise.py index 2f17231d31fee1ad13b74be0d4dcc3accf631f17..aed47499c0fbabadd16d2f069708835be76e1ff1 100644 --- a/test/cinn/test_pe_elementwise.py +++ b/test/cinn/test_pe_elementwise.py @@ -22,7 +22,6 @@ import scipy from cinn import Target, ir, lang, pe, runtime from cinn.common import * from cinn.poly import create_stages -from scipy import special class TestPEElementwise(unittest.TestCase): diff --git a/test/cinn/test_resnet.py b/test/cinn/test_resnet.py index 556436cae33dc013bdb6e63f7246a84b918e2c28..03ff2a8c4aa3192a09ad671e3d5afe4dd3f97c97 100755 --- a/test/cinn/test_resnet.py +++ b/test/cinn/test_resnet.py @@ -17,14 +17,11 @@ import sys import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid enable_gpu = sys.argv.pop() diff --git a/test/cinn/test_resnet18.py b/test/cinn/test_resnet18.py index 453aece0159bf1735e7f9324adb7d2a3bb32823d..6eb59359402547f7e03f61ea6f236b921846285b 100755 --- a/test/cinn/test_resnet18.py +++ b/test/cinn/test_resnet18.py @@ -18,14 +18,11 @@ import sys import time import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid enable_gpu = sys.argv.pop() diff --git a/test/cinn/test_resnet50.py b/test/cinn/test_resnet50.py index 1046f85984e64ee075c099805ef4b0b070338762..fc39e310daefb718d6c6c4acf12bc59a24b53772 100755 --- a/test/cinn/test_resnet50.py +++ b/test/cinn/test_resnet50.py @@ -18,14 +18,11 @@ import sys import time import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid enable_gpu = sys.argv.pop() diff --git a/test/cinn/test_squeezenet.py b/test/cinn/test_squeezenet.py index b85a72d2e1245690894ad44973fd914d34322309..fde7ae12a874e61a86279e7d11103522dd836dc5 100644 --- a/test/cinn/test_squeezenet.py +++ b/test/cinn/test_squeezenet.py @@ -18,14 +18,11 @@ import sys import time import unittest -import cinn import numpy as np -from cinn import Target, ir, lang, runtime from cinn.common import * from cinn.framework import * from cinn.frontend import * -import paddle from paddle import fluid enable_gpu = sys.argv.pop() diff --git a/test/cinn/test_utils.py b/test/cinn/test_utils.py index e1a999d40df549837229d9095c08fab6d502a3fd..5bec1964862623c6819242daca46ea2fa912e55d 100755 --- a/test/cinn/test_utils.py +++ b/test/cinn/test_utils.py @@ -15,13 +15,11 @@ # limitations under the License. import logging -import math import unittest import cinn import numpy as np -from cinn import common, framework, frontend, ir, lang, runtime -from cinn.poly import create_stages +from cinn import common, framework, ir, lang, runtime class SingleOpTester(unittest.TestCase):