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

[CodeStyle][F401] remove unused import in unittests/{asp,autograd,interpreter} (#46376)

上级 ccab0e2a
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import threading, time
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import paddle import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.contrib.sparsity.asp import ASPHelper from paddle.fluid.contrib.sparsity.asp import ASPHelper
import numpy as np import numpy as np
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import threading, time
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import threading, time
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
......
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
# limitations under the License. # limitations under the License.
import paddle.distributed.fleet as fleet import paddle.distributed.fleet as fleet
import paddle.distributed.fleet.base.role_maker as role_maker
import unittest import unittest
import paddle import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
import os import os
from paddle.fluid.contrib.sparsity.asp import ASPHelper from paddle.fluid.contrib.sparsity.asp import ASPHelper
......
...@@ -14,11 +14,9 @@ ...@@ -14,11 +14,9 @@
# limitations under the License. # limitations under the License.
import paddle.distributed.fleet as fleet import paddle.distributed.fleet as fleet
import paddle.distributed.fleet.base.role_maker as role_maker
import unittest import unittest
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core
import os import os
from paddle.static import sparsity from paddle.static import sparsity
from paddle.fluid.contrib.sparsity.asp import ASPHelper from paddle.fluid.contrib.sparsity.asp import ASPHelper
......
...@@ -14,11 +14,9 @@ ...@@ -14,11 +14,9 @@
# limitations under the License. # limitations under the License.
import paddle.distributed.fleet as fleet import paddle.distributed.fleet as fleet
import paddle.distributed.fleet.base.role_maker as role_maker
import unittest import unittest
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core
import os import os
from paddle.static import sparsity from paddle.static import sparsity
from paddle.fluid.contrib.sparsity.asp import ASPHelper from paddle.fluid.contrib.sparsity.asp import ASPHelper
......
...@@ -19,17 +19,13 @@ import unittest ...@@ -19,17 +19,13 @@ import unittest
import numpy as np import numpy as np
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.compat as cpt
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle.incubate.autograd.utils import as_tensors 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 config
import utils import utils
from utils import (_compute_numerical_batch_hessian, _compute_numerical_hessian, from utils import matmul, mul, nested, o2, reduce, reduce_dim
_compute_numerical_vhp, _compute_numerical_jacobian,
_compute_numerical_batch_jacobian)
from utils import matmul, mul, nested, o2, pow, reduce, reduce_dim, unuse
def make_v(f, inputs): def make_v(f, inputs):
......
...@@ -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 typing
import unittest import unittest
import numpy as np import numpy as np
......
...@@ -21,8 +21,6 @@ import paddle.fluid as fluid ...@@ -21,8 +21,6 @@ import paddle.fluid as fluid
import config import config
import utils import utils
from utils import (_compute_numerical_batch_jacobian,
_compute_numerical_jacobian)
paddle.enable_static() paddle.enable_static()
......
...@@ -17,7 +17,7 @@ import unittest ...@@ -17,7 +17,7 @@ import unittest
import paddle import paddle
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.layers.utils import flatten 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() paddle.enable_static()
......
...@@ -17,8 +17,7 @@ import unittest ...@@ -17,8 +17,7 @@ import unittest
import paddle import paddle
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.layers.utils import flatten from paddle.fluid.layers.utils import flatten
from paddle.incubate.autograd.primrules import _orig2prim, _prim2orig, _jvp, _transpose from paddle.incubate.autograd.primrules import _orig2prim
import paddle.fluid.core as core
paddle.enable_static() paddle.enable_static()
......
...@@ -17,7 +17,7 @@ import unittest ...@@ -17,7 +17,7 @@ import unittest
import paddle import paddle
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.layers.utils import flatten 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() paddle.enable_static()
......
...@@ -17,8 +17,7 @@ import uuid ...@@ -17,8 +17,7 @@ import uuid
import numpy as np import numpy as np
import paddle import paddle
from numpy.random import randint, randn from numpy.random import randint, randn
from paddle.incubate.autograd import primops, primx from paddle.incubate.autograd import primops
from paddle.incubate.autograd import utils as prim_utils
import config import config
import utils import utils
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import numpy as np
import paddle import paddle
from paddle.incubate.autograd.primx import Transform, orig2prim, prim2orig from paddle.incubate.autograd.primx import Transform, orig2prim, prim2orig
......
...@@ -15,11 +15,6 @@ ...@@ -15,11 +15,6 @@
import typing import typing
import enum import enum
import sys import sys
import re
import inspect
import functools
import contextlib
import collections
import numpy as np import numpy as np
import paddle import paddle
from paddle.incubate.autograd.utils import as_tensors from paddle.incubate.autograd.utils import as_tensors
......
...@@ -12,13 +12,9 @@ ...@@ -12,13 +12,9 @@
# 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 os
import sys
import unittest import unittest
import paddle import paddle
from paddle.fluid import core, framework 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 from paddle.fluid.framework import Program, program_guard
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
......
...@@ -12,18 +12,11 @@ ...@@ -12,18 +12,11 @@
# 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 os
import sys
import unittest import unittest
import paddle import paddle
from paddle.fluid import core from paddle.fluid.framework import Program
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 test_standalone_controlflow import TestCompatibility from test_standalone_controlflow import TestCompatibility
import numpy as np
paddle.enable_static() paddle.enable_static()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册