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

[CodeStyle][F401] remove unused imports in unittests/distributed_passes,tokenizer,sequence (#46793)

* [CodeStyle][F401] remove unused imports in unittests/distributed_passes,tokenizer,sequence

* add noqa after required imports
上级 300b1009
......@@ -14,12 +14,8 @@
import paddle
import os
import random
import sys
import pickle
import shlex
import shutil
import inspect
import numpy as np
from collections import OrderedDict
from dist_pass_test_base import DistPassTestBase
......
......@@ -23,7 +23,7 @@ import inspect
import numpy as np
from collections import OrderedDict
from paddle.distributed.fleet.launch_utils import run_with_coverage
from paddle.distributed.passes.pass_base import new_pass, PassBase, PassManager
from paddle.distributed.passes.pass_base import PassBase, PassManager
def prepare_python_path_and_return_module(path):
......
......@@ -17,7 +17,6 @@ import paddle
import pickle
import importlib
import os
import sys
from paddle.distributed.fleet.launch_utils import run_with_coverage
from dist_pass_test_base import prepare_python_path_and_return_module, DistPassTestBase
......
......@@ -13,18 +13,11 @@
# limitations under the License.
import os
import random
import sys
import pickle
import shlex
import shutil
import inspect
import unittest
import numpy as np
from collections import OrderedDict
from paddle.distributed.ps.utils.public import logger
from paddle.fluid.tests.unittests.distributed_passes.dist_pass_test_base import prepare_python_path_and_return_module, remove_path_if_exists
import paddle.distributed.fleet as fleet
from paddle.fluid.tests.unittests.distributed_passes.dist_pass_test_base import ( # noqa: F401
prepare_python_path_and_return_module, remove_path_if_exists)
class PsPassTestBase(unittest.TestCase):
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import random
import numpy as np
......
......@@ -18,16 +18,12 @@ import numpy as np
import unittest
import paddle
import paddle.nn as nn
import paddle.distributed.fleet as fleet
from paddle.distributed.fleet import auto
from paddle.distributed.auto_parallel.dist_context import get_default_distributed_context
from paddle.distributed.passes import new_pass, PassManager, PassContext
from paddle.distributed.passes import PassContext, new_pass
from auto_parallel_pass_test_base import AutoPallelPassTestBase
sys.path.append("..")
import auto_parallel_gpt_model as modeling
from auto_parallel_gpt_model import GPTModel, GPTForPretraining, GPTPretrainingCriterion
class TestDataParallelPassWithScale1(AutoPallelPassTestBase):
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import random
import numpy as np
......
......@@ -12,12 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import time
import unittest
import random
import numpy as np
import os
import shutil
import logging
import paddle
......
......@@ -12,16 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import random
import numpy as np
import unittest
import paddle
import paddle.nn as nn
import paddle.distributed.fleet as fleet
from paddle.distributed.fleet import auto
from paddle.distributed.passes import new_pass, PassManager
from auto_parallel_pass_test_base import AutoPallelPassTestBase
......
......@@ -18,15 +18,10 @@ import numpy as np
import unittest
import paddle
import paddle.nn as nn
import paddle.distributed.fleet as fleet
from paddle.distributed.fleet import auto
from paddle.distributed.passes import new_pass, PassManager
from auto_parallel_pass_test_base import AutoPallelPassTestBase
sys.path.append("..")
import auto_parallel_gpt_model as modeling
from auto_parallel_gpt_model import GPTModel, GPTForPretraining, GPTPretrainingCriterion
class TestShardingPass(AutoPallelPassTestBase):
......
......@@ -12,12 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import unittest
import numpy as np
import paddle
from ps_pass_test_base import *
from paddle.fluid.tests.unittests.ps.ps_dnn_trainer import DnnTrainer
from ps_pass_test_base import PsPassTestBase
class TestPsServerPass(PsPassTestBase):
......
......@@ -12,14 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import unittest
import numpy as np
import paddle
from ps_pass_test_base import *
from ps_pass_test_base import remove_path_if_exists, PsPassTestBase
from paddle.distributed.ps.utils.public import logger, ps_log_root_dir
from paddle.fluid.tests.unittests.ps.ps_dnn_trainer import DnnTrainer
class TestPsTrainerPass(PsPassTestBase):
......
......@@ -12,15 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle.fluid as fluid
from paddle.fluid.framework import convert_np_dtype_to_dtype_, Program, program_guard
import paddle.fluid.core as core
from paddle.fluid.framework import Program, program_guard
import numpy as np
import copy
import unittest
import sys
sys.path.append("../")
from op_test import OpTest
class TestSequenceFirstStepOpError(unittest.TestCase):
......
......@@ -12,15 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle.fluid as fluid
from paddle.fluid.framework import convert_np_dtype_to_dtype_, Program, program_guard
import paddle.fluid.core as core
from paddle.fluid.framework import Program, program_guard
import numpy as np
import copy
import unittest
import sys
sys.path.append("../")
from op_test import OpTest
class TestSequenceLastStepOpError(unittest.TestCase):
......
......@@ -14,9 +14,7 @@
import paddle.fluid as fluid
from paddle.fluid.framework import convert_np_dtype_to_dtype_, Program, program_guard
import paddle.fluid.core as core
import numpy as np
import copy
import unittest
import sys
......
......@@ -14,7 +14,6 @@
import unittest
import numpy as np
import math
import sys
sys.path.append("../")
......
......@@ -14,7 +14,6 @@
import unittest
import paddle.fluid as fluid
import paddle.fluid.core as core
import numpy as np
import sys
......
......@@ -13,11 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
import io
import json
import os
import six
import unicodedata
from tokenizer_utils import PretrainedTokenizer
......
......@@ -20,7 +20,7 @@ import json
import os
import unicodedata
from shutil import copyfile
from typing import Iterable, Iterator, Optional, List, Any, Callable, Union
from typing import Optional
from paddle.dataset.common import DATA_HOME
from paddle.utils.download import get_path_from_url
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册