diff --git a/python/paddle/fluid/tests/unittests/asp/asp_pruning_base.py b/python/paddle/fluid/tests/unittests/asp/asp_pruning_base.py index 1fc7439624bd2741011cc839255428e049e39233..6e9603e6761798e3ea3fa1cf6758362c7b3bfd4e 100644 --- a/python/paddle/fluid/tests/unittests/asp/asp_pruning_base.py +++ b/python/paddle/fluid/tests/unittests/asp/asp_pruning_base.py @@ -14,7 +14,6 @@ # limitations under the License. import unittest -import threading, time import paddle import paddle.fluid as fluid import paddle.fluid.core as core diff --git a/python/paddle/fluid/tests/unittests/asp/test_asp_optimize_dynamic.py b/python/paddle/fluid/tests/unittests/asp/test_asp_optimize_dynamic.py index cf4c4d6fcd4fc87ef5c4edf5d3bc6736c329e44f..a501ed427947495373ecad7dc0af02a079b00133 100644 --- a/python/paddle/fluid/tests/unittests/asp/test_asp_optimize_dynamic.py +++ b/python/paddle/fluid/tests/unittests/asp/test_asp_optimize_dynamic.py @@ -15,7 +15,6 @@ import unittest import paddle -import paddle.fluid as fluid import paddle.fluid.core as core from paddle.fluid.contrib.sparsity.asp import ASPHelper import numpy as np diff --git a/python/paddle/fluid/tests/unittests/asp/test_asp_optimize_static.py b/python/paddle/fluid/tests/unittests/asp/test_asp_optimize_static.py index edfe3c192701a0a803ccf033699bc38036a4d18c..b689a40f88fa731d4b86bcfdbecb0b3c459fa32c 100644 --- a/python/paddle/fluid/tests/unittests/asp/test_asp_optimize_static.py +++ b/python/paddle/fluid/tests/unittests/asp/test_asp_optimize_static.py @@ -14,7 +14,6 @@ # limitations under the License. import unittest -import threading, time import paddle import paddle.fluid as fluid import paddle.fluid.core as core diff --git a/python/paddle/fluid/tests/unittests/asp/test_asp_pruning_static.py b/python/paddle/fluid/tests/unittests/asp/test_asp_pruning_static.py index 1ee25114b8b590c13997f94b9bc5120c53f174cf..084fbeef2d3dd0ab3a5e0a0539518e3ae4a067fb 100644 --- a/python/paddle/fluid/tests/unittests/asp/test_asp_pruning_static.py +++ b/python/paddle/fluid/tests/unittests/asp/test_asp_pruning_static.py @@ -14,7 +14,6 @@ # limitations under the License. import unittest -import threading, time import paddle import paddle.fluid as fluid import paddle.fluid.core as core diff --git a/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_dynamic.py b/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_dynamic.py index 09f6096574563cc08239cc09ff03365559d73c7b..d132b319f569af41d141a85b0b6c36e357fe7a7a 100644 --- a/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_dynamic.py +++ b/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_dynamic.py @@ -14,10 +14,8 @@ # limitations under the License. import paddle.distributed.fleet as fleet -import paddle.distributed.fleet.base.role_maker as role_maker import unittest import paddle -import paddle.fluid as fluid import paddle.fluid.core as core import os from paddle.fluid.contrib.sparsity.asp import ASPHelper diff --git a/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py b/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py index bd4e40ce6cbc3043225020ed548e0c5c61a9410e..e5ff5f839e7be8f8befb456f48ade4f46ac601a6 100644 --- a/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py +++ b/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py @@ -14,11 +14,9 @@ # limitations under the License. import paddle.distributed.fleet as fleet -import paddle.distributed.fleet.base.role_maker as role_maker import unittest import paddle import paddle.fluid as fluid -import paddle.fluid.core as core import os from paddle.static import sparsity from paddle.fluid.contrib.sparsity.asp import ASPHelper diff --git a/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_static.py b/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_static.py index 4465dee4d795ef0d0e8d35e2e261777c3d932f84..f205610179108f395071684897373759c42705f7 100644 --- a/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_static.py +++ b/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_static.py @@ -14,11 +14,9 @@ # limitations under the License. import paddle.distributed.fleet as fleet -import paddle.distributed.fleet.base.role_maker as role_maker import unittest import paddle import paddle.fluid as fluid -import paddle.fluid.core as core import os from paddle.static import sparsity from paddle.fluid.contrib.sparsity.asp import ASPHelper diff --git a/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_dynamic.py b/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_dynamic.py index 5eda21eb4c14bf8379c9b4d689e583b4b0fb3ca4..054edf2ea28c1a6b79d43311ceefad7183fdd991 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_dynamic.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_dynamic.py @@ -19,17 +19,13 @@ import unittest import numpy as np import paddle import paddle.fluid as fluid -import paddle.compat as cpt import paddle.nn.functional as F from paddle.incubate.autograd.utils import as_tensors -from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph, _in_eager_without_dygraph_check +from paddle.fluid.framework import _test_eager_guard import config import utils -from utils import (_compute_numerical_batch_hessian, _compute_numerical_hessian, - _compute_numerical_vhp, _compute_numerical_jacobian, - _compute_numerical_batch_jacobian) -from utils import matmul, mul, nested, o2, pow, reduce, reduce_dim, unuse +from utils import matmul, mul, nested, o2, reduce, reduce_dim def make_v(f, inputs): diff --git a/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_prim.py b/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_prim.py index d17420c90454638f4b9fab9273df1d0e7b34ecbd..de12fd1ef901a739dcf10ac44c470753291a2b86 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_prim.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_prim.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import typing import unittest import numpy as np diff --git a/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_static.py b/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_static.py index df637036529d8523a9c7e035f64e60165db9773d..2102cd81ca720a64d643e04390580570efc03f50 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_static.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_autograd_functional_static.py @@ -21,8 +21,6 @@ import paddle.fluid as fluid import config import utils -from utils import (_compute_numerical_batch_jacobian, - _compute_numerical_jacobian) paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/autograd/test_jvp_and_transpose.py b/python/paddle/fluid/tests/unittests/autograd/test_jvp_and_transpose.py index 4a92f1bc65bfdb4d913137fa4951dd3cddd472a9..f345f583945752afdd7a4d3f0c6674708048f1b6 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_jvp_and_transpose.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_jvp_and_transpose.py @@ -17,7 +17,7 @@ import unittest import paddle from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layers.utils import flatten -from paddle.incubate.autograd.primrules import _orig2prim, _prim2orig, _jvp, _transpose +from paddle.incubate.autograd.primrules import _jvp, _transpose paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/autograd/test_orig2prim.py b/python/paddle/fluid/tests/unittests/autograd/test_orig2prim.py index fe7b37941b4c0b2bfc79612526fe957921473a08..4a311fef1dc6dbd4f04940fa319ac6c709a1bd6d 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_orig2prim.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_orig2prim.py @@ -17,8 +17,7 @@ import unittest import paddle from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layers.utils import flatten -from paddle.incubate.autograd.primrules import _orig2prim, _prim2orig, _jvp, _transpose -import paddle.fluid.core as core +from paddle.incubate.autograd.primrules import _orig2prim paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/autograd/test_prim2orig.py b/python/paddle/fluid/tests/unittests/autograd/test_prim2orig.py index a1f80e5506c3dc4a7f6ccf12f9d61dcfe42d3daf..add39fd472fc0416b3bcd5427d869adf3882d9db 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_prim2orig.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_prim2orig.py @@ -17,7 +17,7 @@ import unittest import paddle from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layers.utils import flatten -from paddle.incubate.autograd.primrules import _orig2prim, _prim2orig, _jvp, _transpose +from paddle.incubate.autograd.primrules import _prim2orig paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/autograd/test_primops.py b/python/paddle/fluid/tests/unittests/autograd/test_primops.py index 35291432f6e8fb8da3cf070422139680066200f8..677c064bb786cd6c0ddad20d0481b5988ec1be05 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_primops.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_primops.py @@ -17,8 +17,7 @@ import uuid import numpy as np import paddle from numpy.random import randint, randn -from paddle.incubate.autograd import primops, primx -from paddle.incubate.autograd import utils as prim_utils +from paddle.incubate.autograd import primops import config import utils diff --git a/python/paddle/fluid/tests/unittests/autograd/test_transform.py b/python/paddle/fluid/tests/unittests/autograd/test_transform.py index 32ef176fa5282fd4bbd3c62bf300366361bc443d..f29b0d9b7164c2c938c77a2ab92ba3626540b311 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_transform.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_transform.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from paddle.incubate.autograd.primx import Transform, orig2prim, prim2orig diff --git a/python/paddle/fluid/tests/unittests/autograd/utils.py b/python/paddle/fluid/tests/unittests/autograd/utils.py index d410dd32ddb35e154e93a3884a79982887ff3cba..e7bde31e5415ced249c03ebe548cde6cbb6f71b0 100644 --- a/python/paddle/fluid/tests/unittests/autograd/utils.py +++ b/python/paddle/fluid/tests/unittests/autograd/utils.py @@ -15,11 +15,6 @@ import typing import enum import sys -import re -import inspect -import functools -import contextlib -import collections import numpy as np import paddle from paddle.incubate.autograd.utils import as_tensors diff --git a/python/paddle/fluid/tests/unittests/interpreter/test_standalone_controlflow.py b/python/paddle/fluid/tests/unittests/interpreter/test_standalone_controlflow.py index ef56e087f50e944ee4ea175dd6c54f92f8457cd0..5482eda54467f6cc02c2682a0edada0ba0add84b 100644 --- a/python/paddle/fluid/tests/unittests/interpreter/test_standalone_controlflow.py +++ b/python/paddle/fluid/tests/unittests/interpreter/test_standalone_controlflow.py @@ -12,13 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys import unittest import paddle from paddle.fluid import core, framework -from paddle.fluid.core import StandaloneExecutor -import paddle.fluid as fluid from paddle.fluid.framework import Program, program_guard import paddle.fluid.layers as layers diff --git a/python/paddle/fluid/tests/unittests/interpreter/test_standalone_multiply_write.py b/python/paddle/fluid/tests/unittests/interpreter/test_standalone_multiply_write.py index a4d18d29be44c75eba01ce4533ab64f955ef7613..0a707d1683fd17a16cea4a1d1f0c9effff4f6979 100644 --- a/python/paddle/fluid/tests/unittests/interpreter/test_standalone_multiply_write.py +++ b/python/paddle/fluid/tests/unittests/interpreter/test_standalone_multiply_write.py @@ -12,18 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys import unittest import paddle -from paddle.fluid import core -from paddle.fluid.core import StandaloneExecutor -import paddle.fluid as fluid -from paddle.fluid.framework import Program, program_guard -import paddle.fluid.layers as layers +from paddle.fluid.framework import Program from test_standalone_controlflow import TestCompatibility -import numpy as np paddle.enable_static()