未验证 提交 f4a5fe95 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle][F401] fix incremental flake8 F401 and F541 issues (#46926)

上级 c72b3bfa
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import paddle import paddle
import paddle.distributed as dist
import paddle.fluid.framework as framework import paddle.fluid.framework as framework
from paddle.distributed.communication.group import _get_global_group from paddle.distributed.communication.group import _get_global_group
from paddle.distributed.communication.reduce import _get_reduce_op, ReduceOp from paddle.distributed.communication.reduce import _get_reduce_op, ReduceOp
...@@ -30,11 +29,11 @@ def _check_tensor_shape(tensor, shape, nranks=1): ...@@ -30,11 +29,11 @@ def _check_tensor_shape(tensor, shape, nranks=1):
def _check_tensor_list_shape(tensor_list, shape, nranks=1): def _check_tensor_list_shape(tensor_list, shape, nranks=1):
if len(tensor_list) != nranks: if len(tensor_list) != nranks:
raise RuntimeError( raise RuntimeError(
f"The tensor_list for reduce_scatter is not correctly-sized.") "The tensor_list for reduce_scatter is not correctly-sized.")
for tensor in tensor_list: for tensor in tensor_list:
if tensor.shape != shape: if tensor.shape != shape:
raise RuntimeError( raise RuntimeError(
f"The tensor_list for reduce_scatter is not correctly-sized.") "The tensor_list for reduce_scatter is not correctly-sized.")
def _reduce_scatter_tensor_in_dygraph(out_tensor, def _reduce_scatter_tensor_in_dygraph(out_tensor,
......
...@@ -28,11 +28,11 @@ def _check_tensor_shape(tensor, shape, nranks=1): ...@@ -28,11 +28,11 @@ def _check_tensor_shape(tensor, shape, nranks=1):
def _check_tensor_list_shape(tensor_list, shape, nranks=1): def _check_tensor_list_shape(tensor_list, shape, nranks=1):
if len(tensor_list) != nranks: if len(tensor_list) != nranks:
raise RuntimeError( raise RuntimeError(
f"The tensor_list for scatter is not correctly-sized.") "The tensor_list for scatter is not correctly-sized.")
for tensor in tensor_list: for tensor in tensor_list:
if tensor.shape != shape: if tensor.shape != shape:
raise RuntimeError( raise RuntimeError(
f"The tensor_list for scatter is not correctly-sized.") "The tensor_list for scatter is not correctly-sized.")
def _scatter_tensor_in_dygraph(out_tensor, in_tensor, src, group, sync_op, def _scatter_tensor_in_dygraph(out_tensor, in_tensor, src, group, sync_op,
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
import os import os
import numpy as np import numpy as np
import paddle import paddle
import paddle.fluid as fluid
import paddle.distributed as dist import paddle.distributed as dist
import test_communication_api_base as test_base
import test_collective_api_base as test_collective_base import test_collective_api_base as test_collective_base
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
import os import os
import numpy as np import numpy as np
import paddle import paddle
import paddle.fluid as fluid
import paddle.distributed as dist import paddle.distributed as dist
import test_communication_api_base as test_base
import test_collective_api_base as test_collective_base import test_collective_api_base as test_collective_base
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle
import itertools
import test_communication_api_base as test_base import test_communication_api_base as test_base
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle
import itertools
import test_communication_api_base as test_base import test_communication_api_base as test_base
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle
import itertools
import test_communication_api_base as test_base import test_communication_api_base as test_base
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle
import itertools
import test_communication_api_base as test_base import test_communication_api_base as test_base
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle
import itertools
import test_communication_api_base as test_base import test_communication_api_base as test_base
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle
import itertools
import test_communication_api_base as test_base import test_communication_api_base as test_base
......
...@@ -22,7 +22,6 @@ import paddle ...@@ -22,7 +22,6 @@ import paddle
import paddle.fluid.core as core import paddle.fluid.core as core
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
import paddle.compat as cpt
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import Program, program_guard from paddle.fluid import Program, program_guard
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import six import six
import math import math
import sys
from functools import reduce from functools import reduce
import numpy as np import numpy as np
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import sys
import unittest import unittest
import tempfile import tempfile
import shutil import shutil
......
...@@ -17,7 +17,6 @@ when cmake ON_INFER=ON, which can greatly reduce the volume of the prediction li ...@@ -17,7 +17,6 @@ when cmake ON_INFER=ON, which can greatly reduce the volume of the prediction li
""" """
import os import os
import sys
import re import re
import glob import glob
......
...@@ -17,7 +17,6 @@ when cmake ON_INFER=ON, which can greatly reduce the volume of the prediction li ...@@ -17,7 +17,6 @@ when cmake ON_INFER=ON, which can greatly reduce the volume of the prediction li
""" """
import os import os
import sys
import re import re
import glob import glob
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册