Skip to content

Commit

Permalink
[CodeStyle][F401] remove unused imports in python/paddle (#46731)
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Oct 11, 2022
1 parent 5a57585 commit a5ce223
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 29 deletions.
1 change: 0 additions & 1 deletion python/paddle/_C_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

from paddle.fluid import core
from .fluid import framework

__all__ = []

Expand Down
2 changes: 1 addition & 1 deletion python/paddle/check_import_scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def check_import_scipy(OsName):
print_info = ""
if OsName == 'nt':
try:
import scipy.io as scio
import scipy.io as scio # noqa: F401
except ImportError as e:
print_info = str(e)
if (len(print_info) > 0):
Expand Down
27 changes: 12 additions & 15 deletions python/paddle/common_ops_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from six.moves import reduce
from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.framework import convert_np_dtype_to_dtype_, _non_static_mode, _varbase_creator, in_dygraph_mode, _in_legacy_dygraph
from paddle.fluid.framework import device_guard, default_main_program, dygraph_only, _dygraph_tracer
from paddle.fluid.framework import OpProtoHolder, Variable
from paddle.fluid.initializer import Constant
from paddle.fluid.core import VarDesc
from paddle.fluid import core, dygraph_utils
from paddle.fluid.data_feeder import check_type, check_dtype, check_variable_and_dtype, convert_dtype
from paddle.fluid.layers import fill_constant, utils, scale
from paddle.tensor.layer_function_generator import templatedoc
import paddle.fluid as fluid
import numpy
import warnings
from paddle.fluid.layer_helper import LayerHelper # noqa: F401
from paddle.fluid.param_attr import ParamAttr # noqa: F401
from paddle.fluid.framework import convert_np_dtype_to_dtype_, _non_static_mode, _varbase_creator, in_dygraph_mode, _in_legacy_dygraph # noqa: F401
from paddle.fluid.framework import device_guard, default_main_program, dygraph_only, _dygraph_tracer # noqa: F401
from paddle.fluid.framework import OpProtoHolder, Variable # noqa: F401
from paddle.fluid.initializer import Constant # noqa: F401
from paddle.fluid.core import VarDesc # noqa: F401
from paddle.fluid import core, dygraph_utils # noqa: F401
from paddle.fluid.data_feeder import check_type, check_dtype, check_variable_and_dtype, convert_dtype # noqa: F401
from paddle.fluid.layers import fill_constant, utils, scale # noqa: F401
from paddle.tensor.layer_function_generator import templatedoc # noqa: F401
import paddle.fluid as fluid # noqa: F401
2 changes: 1 addition & 1 deletion python/paddle/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from typing import Sequence
import numpy as np
import paddle
from .tensor.attribute import is_complex, is_floating_point, is_integer
from .tensor.attribute import is_floating_point, is_integer
from .tensor.creation import _real_to_complex_dtype, _complex_to_real_dtype
from .fluid.framework import _in_legacy_dygraph, in_dygraph_mode
from . import _C_ops, _legacy_C_ops
Expand Down
3 changes: 1 addition & 2 deletions python/paddle/nn/functional/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
from paddle import _C_ops, _legacy_C_ops
from ...fluid.framework import _non_static_mode, _in_legacy_dygraph, in_dygraph_mode
from ...fluid.data_feeder import check_variable_and_dtype, check_type
from ...framework import core
from ...common_ops_import import convert_np_dtype_to_dtype_
from ...framework import core, convert_np_dtype_to_dtype_

__all__ = []

Expand Down
4 changes: 1 addition & 3 deletions python/paddle/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Optional

import paddle

from .tensor.attribute import is_complex, is_floating_point
from .tensor.attribute import is_complex
from .fft import fft_r2c, fft_c2r, fft_c2c
from .fluid.data_feeder import check_variable_and_dtype
from .fluid.framework import _non_static_mode
Expand Down
2 changes: 0 additions & 2 deletions python/paddle/tensor/einsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import string
import opt_einsum

from paddle.common_ops_import import dygraph_only

__all__ = []


Expand Down
1 change: 0 additions & 1 deletion python/paddle/tensor/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import paddle
import warnings
from paddle.common_ops_import import core
from paddle.common_ops_import import VarDesc
from paddle import _C_ops, _legacy_C_ops

Expand Down
1 change: 0 additions & 1 deletion python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from paddle.common_ops_import import VarDesc
from paddle.common_ops_import import dygraph_only
from paddle.common_ops_import import OpProtoHolder
from paddle.common_ops_import import templatedoc
from paddle.common_ops_import import dygraph_utils

Expand Down
3 changes: 1 addition & 2 deletions python/paddle/tensor/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
# limitations under the License.
import numpy as np
import paddle
from ..framework import LayerHelper
from ..framework import LayerHelper, convert_np_dtype_to_dtype_
from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype
from ..fluid import layers
from ..framework import core, in_dygraph_mode, _non_static_mode
from ..fluid.framework import _in_legacy_dygraph
from paddle.common_ops_import import convert_np_dtype_to_dtype_
from paddle.common_ops_import import Variable
from paddle.common_ops_import import VarDesc
from paddle import _C_ops, _legacy_C_ops
Expand Down

0 comments on commit a5ce223

Please sign in to comment.