diff --git a/pyproject.toml b/pyproject.toml index f098e720f7f66..48d8ddd181387 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,7 +97,3 @@ ignore = [ "test/dygraph_to_static/test_loop.py" = ["C416", "F821"] # Ignore unnecessary lambda in dy2st unittest test_lambda "test/dygraph_to_static/test_lambda.py" = ["PLC3002"] -# Temporarily ignore CINN files, it will fix later -"test/cinn/**" = [ - "F403", -] diff --git a/test/cinn/op_mappers/test_argmax_op.py b/test/cinn/op_mappers/test_argmax_op.py index 25a228f437b0f..f34ece23f40df 100644 --- a/test/cinn/op_mappers/test_argmax_op.py +++ b/test/cinn/op_mappers/test_argmax_op.py @@ -16,8 +16,6 @@ import unittest -from cinn.common import * -from cinn.frontend import * from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_argmin_op.py b/test/cinn/op_mappers/test_argmin_op.py index cd6582cdb343c..55abe9c8894a1 100644 --- a/test/cinn/op_mappers/test_argmin_op.py +++ b/test/cinn/op_mappers/test_argmin_op.py @@ -16,8 +16,6 @@ import unittest -from cinn.common import * -from cinn.frontend import * from op_mapper_test import OpMapperTest import paddle diff --git a/test/cinn/op_mappers/test_pool2d_op.py b/test/cinn/op_mappers/test_pool2d_op.py index 457953b05d82c..a58e8e645cd60 100644 --- a/test/cinn/op_mappers/test_pool2d_op.py +++ b/test/cinn/op_mappers/test_pool2d_op.py @@ -14,7 +14,7 @@ import unittest -from cinn.common import * +from cinn.common import is_compiled_with_cudnn 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 02071655bd6fd..57547907d2ae9 100755 --- a/test/cinn/ops/op_test.py +++ b/test/cinn/ops/op_test.py @@ -18,8 +18,17 @@ import unittest import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import ( + BFloat16, + Bool, + DefaultHostTarget, + DefaultNVGPUTarget, + Float, + Float16, + Int, + UInt, + is_compiled_with_cuda, +) from cinn.runtime import seed as cinn_seed import paddle diff --git a/test/cinn/ops/test_abs_op.py b/test/cinn/ops/test_abs_op.py index e5f1dfee23458..aca8b631f7a2d 100644 --- a/test/cinn/ops/test_abs_op.py +++ b/test/cinn/ops/test_abs_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_acos_op.py b/test/cinn/ops/test_acos_op.py index 637d4eb7b171c..74eee1dee01c1 100644 --- a/test/cinn/ops/test_acos_op.py +++ b/test/cinn/ops/test_acos_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_acosh_op.py b/test/cinn/ops/test_acosh_op.py index 2d87221f141c4..10cae7040e60b 100644 --- a/test/cinn/ops/test_acosh_op.py +++ b/test/cinn/ops/test_acosh_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_add_op.py b/test/cinn/ops/test_add_op.py index 084f015214a03..5768b8cfe4907 100644 --- a/test/cinn/ops/test_add_op.py +++ b/test/cinn/ops/test_add_op.py @@ -13,8 +13,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_arange_op.py b/test/cinn/ops/test_arange_op.py index 301e655b3ccc1..049101c2a5f44 100644 --- a/test/cinn/ops/test_arange_op.py +++ b/test/cinn/ops/test_arange_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_argmax_op.py b/test/cinn/ops/test_argmax_op.py index 0746cf22e3206..aa6c05829c555 100644 --- a/test/cinn/ops/test_argmax_op.py +++ b/test/cinn/ops/test_argmax_op.py @@ -14,10 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. - import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_argmin_op.py b/test/cinn/ops/test_argmin_op.py index eb54dbc2ce335..f04eda05f7974 100644 --- a/test/cinn/ops/test_argmin_op.py +++ b/test/cinn/ops/test_argmin_op.py @@ -16,8 +16,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_argsort_op.py b/test/cinn/ops/test_argsort_op.py index 4d4e197719aae..5cc90db17636b 100644 --- a/test/cinn/ops/test_argsort_op.py +++ b/test/cinn/ops/test_argsort_op.py @@ -16,8 +16,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_asin_op.py b/test/cinn/ops/test_asin_op.py index 691efd004b932..8cc7793891e07 100644 --- a/test/cinn/ops/test_asin_op.py +++ b/test/cinn/ops/test_asin_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_asinh_op.py b/test/cinn/ops/test_asinh_op.py index 565ba8627ae3c..66979248e39e3 100644 --- a/test/cinn/ops/test_asinh_op.py +++ b/test/cinn/ops/test_asinh_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_atan2_op.py b/test/cinn/ops/test_atan2_op.py index b43b582ef58e6..cacbf9935acfa 100644 --- a/test/cinn/ops/test_atan2_op.py +++ b/test/cinn/ops/test_atan2_op.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_atan_op.py b/test/cinn/ops/test_atan_op.py index 6b3a832407e95..521df1480d1f5 100644 --- a/test/cinn/ops/test_atan_op.py +++ b/test/cinn/ops/test_atan_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_atanh_op.py b/test/cinn/ops/test_atanh_op.py index a7d92572acc32..635389699c896 100644 --- a/test/cinn/ops/test_atanh_op.py +++ b/test/cinn/ops/test_atanh_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_batch_norm_op.py b/test/cinn/ops/test_batch_norm_op.py index 052352f810f89..8442f1e9f40e8 100644 --- a/test/cinn/ops/test_batch_norm_op.py +++ b/test/cinn/ops/test_batch_norm_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_binary_elementwise_op.py b/test/cinn/ops/test_binary_elementwise_op.py index 475ca5c1825a2..74e32edbed31a 100644 --- a/test/cinn/ops/test_binary_elementwise_op.py +++ b/test/cinn/ops/test_binary_elementwise_op.py @@ -13,12 +13,11 @@ # 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 numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool import paddle diff --git a/test/cinn/ops/test_bitcast_convert_op.py b/test/cinn/ops/test_bitcast_convert_op.py index 8a5c7b0c2c00c..f559125fa9058 100644 --- a/test/cinn/ops/test_bitcast_convert_op.py +++ b/test/cinn/ops/test_bitcast_convert_op.py @@ -16,8 +16,8 @@ from struct import pack, unpack import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool import paddle diff --git a/test/cinn/ops/test_bitwise_op.py b/test/cinn/ops/test_bitwise_op.py index f7e7611e2decd..e86fafb0fb299 100644 --- a/test/cinn/ops/test_bitwise_op.py +++ b/test/cinn/ops/test_bitwise_op.py @@ -13,8 +13,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_broadcast_to_op.py b/test/cinn/ops/test_broadcast_to_op.py index 550209d05cec4..06af25824f007 100644 --- a/test/cinn/ops/test_broadcast_to_op.py +++ b/test/cinn/ops/test_broadcast_to_op.py @@ -17,8 +17,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import Float +from cinn.frontend import NetBuilder from op_test import OpTest import paddle diff --git a/test/cinn/ops/test_broadcast_to_op_new.py b/test/cinn/ops/test_broadcast_to_op_new.py index 6878928226c0b..feb3a7d1114c6 100644 --- a/test/cinn/ops/test_broadcast_to_op_new.py +++ b/test/cinn/ops/test_broadcast_to_op_new.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_cast_op.py b/test/cinn/ops/test_cast_op.py index e2b4dfa8f6694..3fb59547d06fd 100644 --- a/test/cinn/ops/test_cast_op.py +++ b/test/cinn/ops/test_cast_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_cbrt_op.py b/test/cinn/ops/test_cbrt_op.py index a8d51446951fd..adecc95b4e309 100644 --- a/test/cinn/ops/test_cbrt_op.py +++ b/test/cinn/ops/test_cbrt_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_ceil_op.py b/test/cinn/ops/test_ceil_op.py index 9d9de3cead12d..232759e999f0e 100644 --- a/test/cinn/ops/test_ceil_op.py +++ b/test/cinn/ops/test_ceil_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_cholesky_op.py b/test/cinn/ops/test_cholesky_op.py index ff6b309364409..661c51e179807 100644 --- a/test/cinn/ops/test_cholesky_op.py +++ b/test/cinn/ops/test_cholesky_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_clz_op.py b/test/cinn/ops/test_clz_op.py index 715a7ae65adcc..e57c0fa212093 100644 --- a/test/cinn/ops/test_clz_op.py +++ b/test/cinn/ops/test_clz_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_comparison_op.py b/test/cinn/ops/test_comparison_op.py index 45c9e08817e90..e6404a8b0f619 100644 --- a/test/cinn/ops/test_comparison_op.py +++ b/test/cinn/ops/test_comparison_op.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_concat_op.py b/test/cinn/ops/test_concat_op.py index 57117a983d9e2..9a04248638086 100755 --- a/test/cinn/ops/test_concat_op.py +++ b/test/cinn/ops/test_concat_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_constant_op.py b/test/cinn/ops/test_constant_op.py index eafd3100d2dd7..f41d0090d53e3 100644 --- a/test/cinn/ops/test_constant_op.py +++ b/test/cinn/ops/test_constant_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_conv2d_op.py b/test/cinn/ops/test_conv2d_op.py index 4ce19366482aa..79dc3d7aed8ca 100755 --- a/test/cinn/ops/test_conv2d_op.py +++ b/test/cinn/ops/test_conv2d_op.py @@ -14,9 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * -from cinn.runtime import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder +from cinn.runtime import set_cinn_cudnn_deterministic from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_cos_op.py b/test/cinn/ops/test_cos_op.py index 831247cca5733..4e5e05c03c609 100644 --- a/test/cinn/ops/test_cos_op.py +++ b/test/cinn/ops/test_cos_op.py @@ -13,9 +13,8 @@ # 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. - -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_cosh_op.py b/test/cinn/ops/test_cosh_op.py index f4c823265ff60..578b0eaec9c15 100644 --- a/test/cinn/ops/test_cosh_op.py +++ b/test/cinn/ops/test_cosh_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_depthwise_conv2d_op.py b/test/cinn/ops/test_depthwise_conv2d_op.py index a0ead5faeec99..57ddc6809998c 100644 --- a/test/cinn/ops/test_depthwise_conv2d_op.py +++ b/test/cinn/ops/test_depthwise_conv2d_op.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cudnn +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_divide_op.py b/test/cinn/ops/test_divide_op.py index be1415c7f8461..ea786955dbf02 100644 --- a/test/cinn/ops/test_divide_op.py +++ b/test/cinn/ops/test_divide_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_dropout_infer_op.py b/test/cinn/ops/test_dropout_infer_op.py index 19b54e9f39b00..adcc6b09eadfb 100644 --- a/test/cinn/ops/test_dropout_infer_op.py +++ b/test/cinn/ops/test_dropout_infer_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_erf_op.py b/test/cinn/ops/test_erf_op.py index 4b84570bd59f4..6f413a3079064 100644 --- a/test/cinn/ops/test_erf_op.py +++ b/test/cinn/ops/test_erf_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_exp_op.py b/test/cinn/ops/test_exp_op.py index 3d378579a8a48..294cf807183f4 100644 --- a/test/cinn/ops/test_exp_op.py +++ b/test/cinn/ops/test_exp_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_expand_dims.py b/test/cinn/ops/test_expand_dims.py index 0b77d7eb5a8ae..4592337873894 100644 --- a/test/cinn/ops/test_expand_dims.py +++ b/test/cinn/ops/test_expand_dims.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_fill_constant_op.py b/test/cinn/ops/test_fill_constant_op.py index 1ccfc448b18eb..e7bb493a1fd8b 100644 --- a/test/cinn/ops/test_fill_constant_op.py +++ b/test/cinn/ops/test_fill_constant_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_floor_divide_op.py b/test/cinn/ops/test_floor_divide_op.py index a14458630592a..bf245668b1948 100644 --- a/test/cinn/ops/test_floor_divide_op.py +++ b/test/cinn/ops/test_floor_divide_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_floor_op.py b/test/cinn/ops/test_floor_op.py index 47b68e95e1242..4149897ff99b0 100644 --- a/test/cinn/ops/test_floor_op.py +++ b/test/cinn/ops/test_floor_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_gather_nd_op.py b/test/cinn/ops/test_gather_nd_op.py index 60e0e71675aa5..d602d21dcb8a6 100644 --- a/test/cinn/ops/test_gather_nd_op.py +++ b/test/cinn/ops/test_gather_nd_op.py @@ -20,8 +20,8 @@ from itertools import product import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import Int, is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool import paddle diff --git a/test/cinn/ops/test_gather_op.py b/test/cinn/ops/test_gather_op.py index 14658e756cef0..afc14a42db239 100644 --- a/test/cinn/ops/test_gather_op.py +++ b/test/cinn/ops/test_gather_op.py @@ -18,8 +18,8 @@ import os import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import Int, is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_gaussian_random_op.py b/test/cinn/ops/test_gaussian_random_op.py index 10677ca62fd6d..17ba245d3117d 100644 --- a/test/cinn/ops/test_gaussian_random_op.py +++ b/test/cinn/ops/test_gaussian_random_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_gelu_op.py b/test/cinn/ops/test_gelu_op.py index df50c85ded8ff..2ab792ae9b513 100644 --- a/test/cinn/ops/test_gelu_op.py +++ b/test/cinn/ops/test_gelu_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_identity_op.py b/test/cinn/ops/test_identity_op.py index dbf595a922296..4c3e9c5558659 100644 --- a/test/cinn/ops/test_identity_op.py +++ b/test/cinn/ops/test_identity_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_is_finite_op.py b/test/cinn/ops/test_is_finite_op.py index a7a94de1f4d25..cf58cf629c572 100644 --- a/test/cinn/ops/test_is_finite_op.py +++ b/test/cinn/ops/test_is_finite_op.py @@ -16,8 +16,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_is_inf_op.py b/test/cinn/ops/test_is_inf_op.py index 90ea69e4cc958..627c49c5a35a1 100644 --- a/test/cinn/ops/test_is_inf_op.py +++ b/test/cinn/ops/test_is_inf_op.py @@ -16,8 +16,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_is_nan_op.py b/test/cinn/ops/test_is_nan_op.py index 8ebe3bda8ef06..f7b3f8961e27c 100644 --- a/test/cinn/ops/test_is_nan_op.py +++ b/test/cinn/ops/test_is_nan_op.py @@ -16,8 +16,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_isclose_op.py b/test/cinn/ops/test_isclose_op.py index 897a06c0f3e5d..7ac763e2860bb 100644 --- a/test/cinn/ops/test_isclose_op.py +++ b/test/cinn/ops/test_isclose_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_left_shift_op.py b/test/cinn/ops/test_left_shift_op.py index 28f5b69853b4b..2af4faf7dace3 100644 --- a/test/cinn/ops/test_left_shift_op.py +++ b/test/cinn/ops/test_left_shift_op.py @@ -14,8 +14,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_log_op.py b/test/cinn/ops/test_log_op.py index f2868b6f46dd9..7d8cd1a78a456 100644 --- a/test/cinn/ops/test_log_op.py +++ b/test/cinn/ops/test_log_op.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.frontend import NetBuilder from op_test import OpTest from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_logical_and_op.py b/test/cinn/ops/test_logical_and_op.py index dfb8cc18b306d..f8a16e7316993 100644 --- a/test/cinn/ops/test_logical_and_op.py +++ b/test/cinn/ops/test_logical_and_op.py @@ -14,8 +14,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_logical_not_op.py b/test/cinn/ops/test_logical_not_op.py index d2fe5733fc89b..a8630e648b8f4 100644 --- a/test/cinn/ops/test_logical_not_op.py +++ b/test/cinn/ops/test_logical_not_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_logical_or_op.py b/test/cinn/ops/test_logical_or_op.py index 594eced153d83..57632c4f9f79c 100644 --- a/test/cinn/ops/test_logical_or_op.py +++ b/test/cinn/ops/test_logical_or_op.py @@ -14,8 +14,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_logical_right_shift_op.py b/test/cinn/ops/test_logical_right_shift_op.py index 8651d505613f2..d8b668111746a 100644 --- a/test/cinn/ops/test_logical_right_shift_op.py +++ b/test/cinn/ops/test_logical_right_shift_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_logical_xor_op.py b/test/cinn/ops/test_logical_xor_op.py index 629a5e68e1752..6ba0f25847e2c 100644 --- a/test/cinn/ops/test_logical_xor_op.py +++ b/test/cinn/ops/test_logical_xor_op.py @@ -14,8 +14,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_lookup_table_op.py b/test/cinn/ops/test_lookup_table_op.py index e1516e8235818..e1711907ad28f 100644 --- a/test/cinn/ops/test_lookup_table_op.py +++ b/test/cinn/ops/test_lookup_table_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_matmul_op.py b/test/cinn/ops/test_matmul_op.py index f47e96e027837..5a1fe42e36ef5 100755 --- a/test/cinn/ops/test_matmul_op.py +++ b/test/cinn/ops/test_matmul_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_max_op.py b/test/cinn/ops/test_max_op.py index a958958c8635a..58e4908fb44a9 100644 --- a/test/cinn/ops/test_max_op.py +++ b/test/cinn/ops/test_max_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_min_op.py b/test/cinn/ops/test_min_op.py index a9847efc06058..273f0936a158f 100644 --- a/test/cinn/ops/test_min_op.py +++ b/test/cinn/ops/test_min_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_mod_op.py b/test/cinn/ops/test_mod_op.py index 8a409b8fec629..7a19381ae495e 100644 --- a/test/cinn/ops/test_mod_op.py +++ b/test/cinn/ops/test_mod_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_mul_op.py b/test/cinn/ops/test_mul_op.py index 7e7b2a2eb4a6f..1ba893a840dbd 100755 --- a/test/cinn/ops/test_mul_op.py +++ b/test/cinn/ops/test_mul_op.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_multiply_op.py b/test/cinn/ops/test_multiply_op.py index 182323166e3ea..75db453f083fb 100644 --- a/test/cinn/ops/test_multiply_op.py +++ b/test/cinn/ops/test_multiply_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_negative_op.py b/test/cinn/ops/test_negative_op.py index d2de296791460..e30204a2a667c 100644 --- a/test/cinn/ops/test_negative_op.py +++ b/test/cinn/ops/test_negative_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_one_hot_op.py b/test/cinn/ops/test_one_hot_op.py index e76cee6e01dd2..d88db984f09cc 100755 --- a/test/cinn/ops/test_one_hot_op.py +++ b/test/cinn/ops/test_one_hot_op.py @@ -15,8 +15,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_pool2d_op.py b/test/cinn/ops/test_pool2d_op.py index eb5ff95167a14..f7d3eee667187 100644 --- a/test/cinn/ops/test_pool2d_op.py +++ b/test/cinn/ops/test_pool2d_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cudnn +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_popc_op.py b/test/cinn/ops/test_popc_op.py index 1b03c4d041cc4..954354ccfba13 100644 --- a/test/cinn/ops/test_popc_op.py +++ b/test/cinn/ops/test_popc_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_pow_op.py b/test/cinn/ops/test_pow_op.py index 4728fc95b96be..7d58869c109f1 100644 --- a/test/cinn/ops/test_pow_op.py +++ b/test/cinn/ops/test_pow_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_randint_op.py b/test/cinn/ops/test_randint_op.py index b2102357d8495..45a3d3c802661 100644 --- a/test/cinn/ops/test_randint_op.py +++ b/test/cinn/ops/test_randint_op.py @@ -16,8 +16,8 @@ import unittest -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool import paddle diff --git a/test/cinn/ops/test_reciprocal_op.py b/test/cinn/ops/test_reciprocal_op.py index 8a8eaf2276dee..bbc1e447694fb 100644 --- a/test/cinn/ops/test_reciprocal_op.py +++ b/test/cinn/ops/test_reciprocal_op.py @@ -14,8 +14,7 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.frontend import NetBuilder from op_test import OpTest from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_reduce_op.py b/test/cinn/ops/test_reduce_op.py index 238dcbf1a5401..07170a0af48b6 100644 --- a/test/cinn/ops/test_reduce_op.py +++ b/test/cinn/ops/test_reduce_op.py @@ -17,8 +17,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import Bool, Float, Int, is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool import paddle diff --git a/test/cinn/ops/test_reduce_op_new.py b/test/cinn/ops/test_reduce_op_new.py index cb295ccff412e..c47e511133719 100644 --- a/test/cinn/ops/test_reduce_op_new.py +++ b/test/cinn/ops/test_reduce_op_new.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_relu6_op.py b/test/cinn/ops/test_relu6_op.py index 41369dd155467..3248b6836ba9f 100644 --- a/test/cinn/ops/test_relu6_op.py +++ b/test/cinn/ops/test_relu6_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_relu_op.py b/test/cinn/ops/test_relu_op.py index e5b5a6afe588e..2050305464d2d 100755 --- a/test/cinn/ops/test_relu_op.py +++ b/test/cinn/ops/test_relu_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_remainder_op.py b/test/cinn/ops/test_remainder_op.py index 597c5bbcf6b1c..458346d47b7b1 100644 --- a/test/cinn/ops/test_remainder_op.py +++ b/test/cinn/ops/test_remainder_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_repeat_op.py b/test/cinn/ops/test_repeat_op.py index 10463d6af4f45..efde14180ffb8 100644 --- a/test/cinn/ops/test_repeat_op.py +++ b/test/cinn/ops/test_repeat_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_reshape_op.py b/test/cinn/ops/test_reshape_op.py index 88152363d3f79..d300b61ea1784 100644 --- a/test/cinn/ops/test_reshape_op.py +++ b/test/cinn/ops/test_reshape_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_resize_op.py b/test/cinn/ops/test_resize_op.py index 9c6118cdb47c9..b2eb0d62dac71 100644 --- a/test/cinn/ops/test_resize_op.py +++ b/test/cinn/ops/test_resize_op.py @@ -15,9 +15,6 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * - # paddle resize is based on cv2 module # This test requires cv2 module (pip3.6 install opencv_python==3.2.0.7) # @OpTestTool.skip_if(not is_compiled_with_cuda(), diff --git a/test/cinn/ops/test_reverse_op.py b/test/cinn/ops/test_reverse_op.py index 83b6e4390bf05..e6a61dde1a073 100755 --- a/test/cinn/ops/test_reverse_op.py +++ b/test/cinn/ops/test_reverse_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_right_shift_op.py b/test/cinn/ops/test_right_shift_op.py index 400d82110d198..c059247a04e7b 100644 --- a/test/cinn/ops/test_right_shift_op.py +++ b/test/cinn/ops/test_right_shift_op.py @@ -14,8 +14,8 @@ import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_round_op.py b/test/cinn/ops/test_round_op.py index dab3ef16775aa..ade311c9488c8 100644 --- a/test/cinn/ops/test_round_op.py +++ b/test/cinn/ops/test_round_op.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_rsqrt_op.py b/test/cinn/ops/test_rsqrt_op.py index c48ebc92aa8cd..4ccc4b7e4c56e 100644 --- a/test/cinn/ops/test_rsqrt_op.py +++ b/test/cinn/ops/test_rsqrt_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_scale_op.py b/test/cinn/ops/test_scale_op.py index 577093dbaf550..4a816158838ff 100644 --- a/test/cinn/ops/test_scale_op.py +++ b/test/cinn/ops/test_scale_op.py @@ -13,8 +13,8 @@ # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_scatter_add.py b/test/cinn/ops/test_scatter_add.py index 487b3f7cbb1b1..eddcc9457e7e1 100644 --- a/test/cinn/ops/test_scatter_add.py +++ b/test/cinn/ops/test_scatter_add.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import Float, Int, is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper, run_test diff --git a/test/cinn/ops/test_scatter_assign_op.py b/test/cinn/ops/test_scatter_assign_op.py index 628306a1dffb6..16cd97430e123 100644 --- a/test/cinn/ops/test_scatter_assign_op.py +++ b/test/cinn/ops/test_scatter_assign_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_select_op.py b/test/cinn/ops/test_select_op.py index 19ccbcb8df353..0897f7c6fa8fe 100644 --- a/test/cinn/ops/test_select_op.py +++ b/test/cinn/ops/test_select_op.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_sigmoid_op.py b/test/cinn/ops/test_sigmoid_op.py index e7d91fbfe130f..f6410b83b5dd5 100644 --- a/test/cinn/ops/test_sigmoid_op.py +++ b/test/cinn/ops/test_sigmoid_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_sign_op.py b/test/cinn/ops/test_sign_op.py index 87fc1cb7cff1f..25397afd1e9f1 100644 --- a/test/cinn/ops/test_sign_op.py +++ b/test/cinn/ops/test_sign_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_sin_op.py b/test/cinn/ops/test_sin_op.py index 93b6071468262..dda3b59113fde 100644 --- a/test/cinn/ops/test_sin_op.py +++ b/test/cinn/ops/test_sin_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_sinh_op.py b/test/cinn/ops/test_sinh_op.py index 84ad57dd8d07b..216878d7bf62a 100644 --- a/test/cinn/ops/test_sinh_op.py +++ b/test/cinn/ops/test_sinh_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_slice_assign_op.py b/test/cinn/ops/test_slice_assign_op.py index 5159517eb234f..e282b8116497c 100644 --- a/test/cinn/ops/test_slice_assign_op.py +++ b/test/cinn/ops/test_slice_assign_op.py @@ -15,8 +15,8 @@ # limitations under the License. import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_slice_op.py b/test/cinn/ops/test_slice_op.py index 1185371fee93e..68be813abb256 100644 --- a/test/cinn/ops/test_slice_op.py +++ b/test/cinn/ops/test_slice_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_softmax_op.py b/test/cinn/ops/test_softmax_op.py index 359e1c10da81b..b7c346b1b2717 100644 --- a/test/cinn/ops/test_softmax_op.py +++ b/test/cinn/ops/test_softmax_op.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_sort_op.py b/test/cinn/ops/test_sort_op.py index 39674039d3c70..b1e2cb660c340 100644 --- a/test/cinn/ops/test_sort_op.py +++ b/test/cinn/ops/test_sort_op.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.frontend import NetBuilder from op_test import OpTest from op_test_helper import TestCaseHelper, run_test diff --git a/test/cinn/ops/test_split_op.py b/test/cinn/ops/test_split_op.py index e709500c537e7..cf5d7ffc9b98b 100755 --- a/test/cinn/ops/test_split_op.py +++ b/test/cinn/ops/test_split_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_sqrt_op.py b/test/cinn/ops/test_sqrt_op.py index 2af490581e6c3..5315374702472 100644 --- a/test/cinn/ops/test_sqrt_op.py +++ b/test/cinn/ops/test_sqrt_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_squeeze_op.py b/test/cinn/ops/test_squeeze_op.py index 23d8d2fc98c72..bb8b25cf9b415 100644 --- a/test/cinn/ops/test_squeeze_op.py +++ b/test/cinn/ops/test_squeeze_op.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.frontend import NetBuilder from op_test import OpTest from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_subtract_op.py b/test/cinn/ops/test_subtract_op.py index 6951d94123790..3f357f7cbba59 100644 --- a/test/cinn/ops/test_subtract_op.py +++ b/test/cinn/ops/test_subtract_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_sum_op.py b/test/cinn/ops/test_sum_op.py index 92b6efa299809..fdee4699cb554 100644 --- a/test/cinn/ops/test_sum_op.py +++ b/test/cinn/ops/test_sum_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_tan_op.py b/test/cinn/ops/test_tan_op.py index bd43fa6ad4243..80f6d480b440b 100644 --- a/test/cinn/ops/test_tan_op.py +++ b/test/cinn/ops/test_tan_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_tanh_op.py b/test/cinn/ops/test_tanh_op.py index 15c806f89e152..667feff1db7ae 100644 --- a/test/cinn/ops/test_tanh_op.py +++ b/test/cinn/ops/test_tanh_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_top_k_op.py b/test/cinn/ops/test_top_k_op.py index 8974ac9942db5..dc702279e5d24 100644 --- a/test/cinn/ops/test_top_k_op.py +++ b/test/cinn/ops/test_top_k_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper, run_test diff --git a/test/cinn/ops/test_transpose_op.py b/test/cinn/ops/test_transpose_op.py index ee3f0038a2517..9810c13844044 100644 --- a/test/cinn/ops/test_transpose_op.py +++ b/test/cinn/ops/test_transpose_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_triangular_solve_op.py b/test/cinn/ops/test_triangular_solve_op.py index 556da4c456973..691d98058c41c 100644 --- a/test/cinn/ops/test_triangular_solve_op.py +++ b/test/cinn/ops/test_triangular_solve_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper, run_test diff --git a/test/cinn/ops/test_trunc_op.py b/test/cinn/ops/test_trunc_op.py index 64df64d219928..bfba7f6c182bb 100644 --- a/test/cinn/ops/test_trunc_op.py +++ b/test/cinn/ops/test_trunc_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_unary_elementwise_op.py b/test/cinn/ops/test_unary_elementwise_op.py index f9207bcb30756..fb0f5a41c4b27 100644 --- a/test/cinn/ops/test_unary_elementwise_op.py +++ b/test/cinn/ops/test_unary_elementwise_op.py @@ -17,8 +17,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool import paddle diff --git a/test/cinn/ops/test_uniform_random_op.py b/test/cinn/ops/test_uniform_random_op.py index 0cfc2de497be5..ba0cb15ac449e 100644 --- a/test/cinn/ops/test_uniform_random_op.py +++ b/test/cinn/ops/test_uniform_random_op.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cinn.common import * -from cinn.frontend import * +from cinn.common import is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool from op_test_helper import TestCaseHelper diff --git a/test/cinn/ops/test_zero_dim_tensor.py b/test/cinn/ops/test_zero_dim_tensor.py index a716d90ab400c..019b7638f7ef7 100644 --- a/test/cinn/ops/test_zero_dim_tensor.py +++ b/test/cinn/ops/test_zero_dim_tensor.py @@ -17,8 +17,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.frontend import * +from cinn.common import Bool, Float, Int, is_compiled_with_cuda +from cinn.frontend import NetBuilder from op_test import OpTest, OpTestTool import paddle diff --git a/test/cinn/passes/test_auto_cast_pass.py b/test/cinn/passes/test_auto_cast_pass.py index 16b7f180b354b..3fea95f9f0a6c 100644 --- a/test/cinn/passes/test_auto_cast_pass.py +++ b/test/cinn/passes/test_auto_cast_pass.py @@ -16,8 +16,6 @@ import unittest -from cinn.common import * -from cinn.frontend import * from pass_test import PassTest diff --git a/test/cinn/passes/test_expand_zero_dim_pass.py b/test/cinn/passes/test_expand_zero_dim_pass.py index 4eb8dc8d1adfe..57acf82eeebe9 100644 --- a/test/cinn/passes/test_expand_zero_dim_pass.py +++ b/test/cinn/passes/test_expand_zero_dim_pass.py @@ -17,8 +17,6 @@ import unittest import numpy as np -from cinn.common import * -from cinn.frontend import * from pass_test import PassTest diff --git a/test/cinn/passes/test_transpose_floding_input_pass.py b/test/cinn/passes/test_transpose_floding_input_pass.py index 68fa1454899d9..f3d7904198882 100644 --- a/test/cinn/passes/test_transpose_floding_input_pass.py +++ b/test/cinn/passes/test_transpose_floding_input_pass.py @@ -16,8 +16,6 @@ import unittest -from cinn.common import * -from cinn.frontend import * from pass_test import PassTest diff --git a/test/cinn/passes/test_transpose_floding_output_pass.py b/test/cinn/passes/test_transpose_floding_output_pass.py index 4eaeace2cb480..306e3c1380714 100644 --- a/test/cinn/passes/test_transpose_floding_output_pass.py +++ b/test/cinn/passes/test_transpose_floding_output_pass.py @@ -16,8 +16,6 @@ import unittest -from cinn.common import * -from cinn.frontend import * from pass_test import PassTest diff --git a/test/cinn/test_common.py b/test/cinn/test_common.py index 415cab8b64a16..e76b51b16c5ee 100644 --- a/test/cinn/test_common.py +++ b/test/cinn/test_common.py @@ -16,7 +16,7 @@ import unittest -from cinn.common import * +from cinn.common import Bool, Float, Int, UInt, make_const class TestType(unittest.TestCase): diff --git a/test/cinn/test_computation.py b/test/cinn/test_computation.py index e09074810fd0f..19deb70a3e6cf 100755 --- a/test/cinn/test_computation.py +++ b/test/cinn/test_computation.py @@ -18,9 +18,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget, Float +from cinn.frontend import Computation, NetBuilder import paddle from paddle import fluid, static diff --git a/test/cinn/test_efficientnet.py b/test/cinn/test_efficientnet.py index 7df10747a6983..4a627e090220d 100755 --- a/test/cinn/test_efficientnet.py +++ b/test/cinn/test_efficientnet.py @@ -19,9 +19,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid diff --git a/test/cinn/test_facedet.py b/test/cinn/test_facedet.py index 88e98cc4fb025..20290846625c9 100755 --- a/test/cinn/test_facedet.py +++ b/test/cinn/test_facedet.py @@ -19,9 +19,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid diff --git a/test/cinn/test_frontend.py b/test/cinn/test_frontend.py index 9b33174e8a79a..d7ecf05d6840f 100755 --- a/test/cinn/test_frontend.py +++ b/test/cinn/test_frontend.py @@ -18,9 +18,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid diff --git a/test/cinn/test_hlir_framework.py b/test/cinn/test_hlir_framework.py index 1e7d36cacac50..42711ded4902d 100644 --- a/test/cinn/test_hlir_framework.py +++ b/test/cinn/test_hlir_framework.py @@ -15,7 +15,8 @@ import unittest import numpy as np -from cinn.framework import * +from cinn import Target +from cinn.framework import Tensor class TensorTest(unittest.TestCase): diff --git a/test/cinn/test_ir.py b/test/cinn/test_ir.py index d9dd02eea5704..c4da5c8f912b9 100644 --- a/test/cinn/test_ir.py +++ b/test/cinn/test_ir.py @@ -16,9 +16,8 @@ import unittest -from cinn.common import * -from cinn.ir import * -from cinn.optim import * +from cinn.ir import Expr, Var +from cinn.optim import simplify class TestIR(unittest.TestCase): diff --git a/test/cinn/test_mobilenetv1.py b/test/cinn/test_mobilenetv1.py index 06365105fff00..44d6de40c198f 100644 --- a/test/cinn/test_mobilenetv1.py +++ b/test/cinn/test_mobilenetv1.py @@ -19,9 +19,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid diff --git a/test/cinn/test_mobilenetv2.py b/test/cinn/test_mobilenetv2.py index 461bfdd630c32..b81314d87f5b8 100755 --- a/test/cinn/test_mobilenetv2.py +++ b/test/cinn/test_mobilenetv2.py @@ -19,9 +19,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid diff --git a/test/cinn/test_netbuilder.py b/test/cinn/test_netbuilder.py index 3e6a3081ed6c3..1f5cf4590a3d7 100755 --- a/test/cinn/test_netbuilder.py +++ b/test/cinn/test_netbuilder.py @@ -18,9 +18,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget, Float +from cinn.frontend import NetBuilder import paddle from paddle import static diff --git a/test/cinn/test_op_benchmark.py b/test/cinn/test_op_benchmark.py index 1240b5134811e..0f598d93eb0f4 100755 --- a/test/cinn/test_op_benchmark.py +++ b/test/cinn/test_op_benchmark.py @@ -18,9 +18,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget, Float +from cinn.frontend import Program, Variable import paddle from paddle import static diff --git a/test/cinn/test_pe_elementwise.py b/test/cinn/test_pe_elementwise.py index aed47499c0fba..9a670359207b2 100644 --- a/test/cinn/test_pe_elementwise.py +++ b/test/cinn/test_pe_elementwise.py @@ -20,7 +20,6 @@ import numpy as np import scipy from cinn import Target, ir, lang, pe, runtime -from cinn.common import * from cinn.poly import create_stages diff --git a/test/cinn/test_pe_reduction.py b/test/cinn/test_pe_reduction.py index 386f6faa84180..e6a73c9fd11e2 100644 --- a/test/cinn/test_pe_reduction.py +++ b/test/cinn/test_pe_reduction.py @@ -19,7 +19,6 @@ import cinn import numpy as np from cinn import Target, ir, lang, pe, runtime -from cinn.common import * from cinn.poly import create_stages diff --git a/test/cinn/test_pe_transform.py b/test/cinn/test_pe_transform.py index 8b08068f7e17b..f6c6b6237d228 100644 --- a/test/cinn/test_pe_transform.py +++ b/test/cinn/test_pe_transform.py @@ -19,7 +19,6 @@ import cinn import numpy as np from cinn import Target, ir, lang, pe, runtime -from cinn.common import * from cinn.poly import create_stages diff --git a/test/cinn/test_resnet.py b/test/cinn/test_resnet.py index 03ff2a8c4aa31..e75975825ac9f 100755 --- a/test/cinn/test_resnet.py +++ b/test/cinn/test_resnet.py @@ -18,9 +18,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid diff --git a/test/cinn/test_resnet18.py b/test/cinn/test_resnet18.py index 6eb5935940254..7b66b3a7c3538 100755 --- a/test/cinn/test_resnet18.py +++ b/test/cinn/test_resnet18.py @@ -19,9 +19,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid diff --git a/test/cinn/test_resnet50.py b/test/cinn/test_resnet50.py index fc39e310daefb..e63415db9ed95 100755 --- a/test/cinn/test_resnet50.py +++ b/test/cinn/test_resnet50.py @@ -19,9 +19,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid diff --git a/test/cinn/test_squeezenet.py b/test/cinn/test_squeezenet.py index fde7ae12a874e..78a28d33abf19 100644 --- a/test/cinn/test_squeezenet.py +++ b/test/cinn/test_squeezenet.py @@ -19,9 +19,8 @@ import unittest import numpy as np -from cinn.common import * -from cinn.framework import * -from cinn.frontend import * +from cinn.common import DefaultHostTarget, DefaultNVGPUTarget +from cinn.frontend import Interpreter from paddle import fluid