From 2d3b0c49e9dd65d83e298222fb2a63670ab8f442 Mon Sep 17 00:00:00 2001 From: Shuangchi He <34329208+Yulv-git@users.noreply.github.com> Date: Mon, 10 Oct 2022 18:10:56 +0800 Subject: [PATCH] [CodeStyle][F401] remove unused imports in python_paddle/io_costmodel_geometric_vision_static. (#46755) Signed-off-by: Yulv-git Signed-off-by: Yulv-git --- python/paddle/geometric/math.py | 2 +- python/paddle/geometric/message_passing/send_recv.py | 4 ++-- python/paddle/geometric/reindex.py | 3 +-- python/paddle/geometric/sampling/neighbors.py | 3 +-- python/paddle/static/io.py | 2 +- python/paddle/vision/datasets/flowers.py | 1 - python/paddle/vision/datasets/mnist.py | 1 - python/paddle/vision/ops.py | 4 +--- python/paddle/vision/transforms/functional.py | 4 ---- python/paddle/vision/transforms/functional_cv2.py | 2 -- python/paddle/vision/transforms/functional_pil.py | 3 --- python/paddle/vision/transforms/functional_tensor.py | 3 --- python/paddle/vision/transforms/transforms.py | 3 --- 13 files changed, 7 insertions(+), 28 deletions(-) diff --git a/python/paddle/geometric/math.py b/python/paddle/geometric/math.py index 673b83f980..186fe5c2d7 100644 --- a/python/paddle/geometric/math.py +++ b/python/paddle/geometric/math.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from paddle.fluid.layer_helper import LayerHelper, _non_static_mode +from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.data_feeder import check_variable_and_dtype from paddle import _C_ops, _legacy_C_ops from paddle.fluid.framework import _in_legacy_dygraph, in_dygraph_mode diff --git a/python/paddle/geometric/message_passing/send_recv.py b/python/paddle/geometric/message_passing/send_recv.py index f2b3029e39..cf290b29be 100644 --- a/python/paddle/geometric/message_passing/send_recv.py +++ b/python/paddle/geometric/message_passing/send_recv.py @@ -14,9 +14,9 @@ import numpy as np from paddle.fluid.layer_helper import LayerHelper -from paddle.fluid.framework import _non_static_mode, _in_legacy_dygraph, in_dygraph_mode +from paddle.fluid.framework import _in_legacy_dygraph, in_dygraph_mode from paddle.fluid.framework import Variable -from paddle.fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype, convert_dtype +from paddle.fluid.data_feeder import check_dtype, check_type, check_variable_and_dtype from paddle import _C_ops, _legacy_C_ops from .utils import convert_out_size_to_list, get_out_size_tensor_inputs, reshape_lhs_rhs diff --git a/python/paddle/geometric/reindex.py b/python/paddle/geometric/reindex.py index a575e6916c..3c4cfb964e 100644 --- a/python/paddle/geometric/reindex.py +++ b/python/paddle/geometric/reindex.py @@ -16,8 +16,7 @@ import paddle from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.framework import _non_static_mode, Variable from paddle.fluid.data_feeder import check_variable_and_dtype -from paddle.fluid import core -from paddle import _C_ops, _legacy_C_ops +from paddle import _legacy_C_ops __all__ = [] diff --git a/python/paddle/geometric/sampling/neighbors.py b/python/paddle/geometric/sampling/neighbors.py index 62c01a11c6..48fb22d4fe 100644 --- a/python/paddle/geometric/sampling/neighbors.py +++ b/python/paddle/geometric/sampling/neighbors.py @@ -12,11 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.framework import _non_static_mode from paddle.fluid.data_feeder import check_variable_and_dtype -from paddle import _C_ops, _legacy_C_ops +from paddle import _legacy_C_ops __all__ = [] diff --git a/python/paddle/static/io.py b/python/paddle/static/io.py index f5284de864..1f625f8635 100644 --- a/python/paddle/static/io.py +++ b/python/paddle/static/io.py @@ -33,7 +33,7 @@ from paddle.fluid import ( ) from paddle.fluid.io import prepend_feed_ops, append_fetch_ops from paddle.fluid.framework import static_only, Parameter -from paddle.fluid.executor import Executor, global_scope +from paddle.fluid.executor import global_scope from paddle.fluid.log_helper import get_logger __all__ = [] diff --git a/python/paddle/vision/datasets/flowers.py b/python/paddle/vision/datasets/flowers.py index 157bca2148..963d639ed1 100644 --- a/python/paddle/vision/datasets/flowers.py +++ b/python/paddle/vision/datasets/flowers.py @@ -13,7 +13,6 @@ # limitations under the License. import os -import io import tarfile import numpy as np from PIL import Image diff --git a/python/paddle/vision/datasets/mnist.py b/python/paddle/vision/datasets/mnist.py index 22ceb8304e..5b819fb3bb 100644 --- a/python/paddle/vision/datasets/mnist.py +++ b/python/paddle/vision/datasets/mnist.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import gzip import struct import numpy as np diff --git a/python/paddle/vision/ops.py b/python/paddle/vision/ops.py index 11bedb6c31..112d233cc4 100755 --- a/python/paddle/vision/ops.py +++ b/python/paddle/vision/ops.py @@ -14,13 +14,11 @@ import numpy as np from ..fluid.layer_helper import LayerHelper -from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype -from ..fluid import core, layers +from ..fluid.data_feeder import check_type, check_variable_and_dtype from ..fluid.layers import nn, utils from ..nn import Layer, Conv2D, Sequential, ReLU, BatchNorm2D from ..fluid.initializer import Normal from ..fluid.framework import _non_static_mode, in_dygraph_mode, _in_legacy_dygraph -from paddle.common_ops_import import * from paddle import _C_ops, _legacy_C_ops from ..framework import _current_expected_place diff --git a/python/paddle/vision/transforms/functional.py b/python/paddle/vision/transforms/functional.py index f0a3c1793c..99d27a60ae 100644 --- a/python/paddle/vision/transforms/functional.py +++ b/python/paddle/vision/transforms/functional.py @@ -12,15 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import math import numbers -import warnings -import collections import numpy as np from PIL import Image -from numpy import sin, cos, tan import paddle from . import functional_pil as F_pil diff --git a/python/paddle/vision/transforms/functional_cv2.py b/python/paddle/vision/transforms/functional_cv2.py index 52acb85392..ccd638089a 100644 --- a/python/paddle/vision/transforms/functional_cv2.py +++ b/python/paddle/vision/transforms/functional_cv2.py @@ -15,11 +15,9 @@ import sys import math import numbers -import warnings import collections import numpy as np -from numpy import sin, cos, tan import paddle from paddle.utils import try_import diff --git a/python/paddle/vision/transforms/functional_pil.py b/python/paddle/vision/transforms/functional_pil.py index 8eedd87428..cd4556effb 100644 --- a/python/paddle/vision/transforms/functional_pil.py +++ b/python/paddle/vision/transforms/functional_pil.py @@ -13,14 +13,11 @@ # limitations under the License. import sys -import math import numbers -import warnings import collections from PIL import Image, ImageOps, ImageEnhance import numpy as np -from numpy import sin, cos, tan import paddle if sys.version_info < (3, 3): diff --git a/python/paddle/vision/transforms/functional_tensor.py b/python/paddle/vision/transforms/functional_tensor.py index cdff801eaf..911f7e2d26 100644 --- a/python/paddle/vision/transforms/functional_tensor.py +++ b/python/paddle/vision/transforms/functional_tensor.py @@ -18,9 +18,6 @@ import numbers import paddle import paddle.nn.functional as F -import sys -import collections - __all__ = [] diff --git a/python/paddle/vision/transforms/transforms.py b/python/paddle/vision/transforms/transforms.py index 3edc48e472..5472df2fd9 100644 --- a/python/paddle/vision/transforms/transforms.py +++ b/python/paddle/vision/transforms/transforms.py @@ -18,13 +18,10 @@ import random import numpy as np import numbers -import types import collections -import warnings import traceback import paddle -from paddle.utils import try_import from . import functional as F if sys.version_info < (3, 3): -- GitLab