Skip to content

Commit

Permalink
[CodeStyle][CINN] ruff F403 in test/cinn (PaddlePaddle#55255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liyulingyue authored and wz1qqx committed Jul 31, 2023
1 parent af522d6 commit bda85c1
Show file tree
Hide file tree
Showing 134 changed files with 250 additions and 282 deletions.
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
2 changes: 0 additions & 2 deletions test/cinn/op_mappers/test_argmax_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

import unittest

from cinn.common import *
from cinn.frontend import *
from op_mapper_test import OpMapperTest

import paddle
Expand Down
2 changes: 0 additions & 2 deletions test/cinn/op_mappers/test_argmin_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

import unittest

from cinn.common import *
from cinn.frontend import *
from op_mapper_test import OpMapperTest

import paddle
Expand Down
2 changes: 1 addition & 1 deletion test/cinn/op_mappers/test_pool2d_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions test/cinn/ops/op_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_abs_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_acos_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_acosh_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_add_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_arange_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions test/cinn/ops/test_argmax_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_argmin_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_argsort_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_asin_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_asinh_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_atan2_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_atan_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_atanh_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_batch_norm_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions test/cinn/ops/test_binary_elementwise_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_bitcast_convert_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_bitwise_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_broadcast_to_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_broadcast_to_op_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_cast_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_cbrt_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_ceil_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_cholesky_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_clz_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_comparison_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_concat_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_constant_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions test/cinn/ops/test_conv2d_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions test/cinn/ops/test_cos_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/cinn/ops/test_cosh_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading

0 comments on commit bda85c1

Please sign in to comment.