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

[CodeStyle][F401] remove unused imports in python/paddle (#46731)

上级 5a575859
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
from paddle.fluid import core from paddle.fluid import core
from .fluid import framework
__all__ = [] __all__ = []
......
...@@ -17,7 +17,7 @@ def check_import_scipy(OsName): ...@@ -17,7 +17,7 @@ def check_import_scipy(OsName):
print_info = "" print_info = ""
if OsName == 'nt': if OsName == 'nt':
try: try:
import scipy.io as scio import scipy.io as scio # noqa: F401
except ImportError as e: except ImportError as e:
print_info = str(e) print_info = str(e)
if (len(print_info) > 0): if (len(print_info) > 0):
......
...@@ -11,18 +11,15 @@ ...@@ -11,18 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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.
from six.moves import reduce from paddle.fluid.layer_helper import LayerHelper # noqa: F401
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.param_attr import ParamAttr # noqa: F401
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 # noqa: F401
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 # noqa: F401
from paddle.fluid.framework import device_guard, default_main_program, dygraph_only, _dygraph_tracer from paddle.fluid.framework import OpProtoHolder, Variable # noqa: F401
from paddle.fluid.framework import OpProtoHolder, Variable from paddle.fluid.initializer import Constant # noqa: F401
from paddle.fluid.initializer import Constant from paddle.fluid.core import VarDesc # noqa: F401
from paddle.fluid.core import VarDesc from paddle.fluid import core, dygraph_utils # noqa: F401
from paddle.fluid import core, dygraph_utils from paddle.fluid.data_feeder import check_type, check_dtype, check_variable_and_dtype, convert_dtype # noqa: F401
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 # noqa: F401
from paddle.fluid.layers import fill_constant, utils, scale from paddle.tensor.layer_function_generator import templatedoc # noqa: F401
from paddle.tensor.layer_function_generator import templatedoc import paddle.fluid as fluid # noqa: F401
import paddle.fluid as fluid
import numpy
import warnings
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from typing import Sequence from typing import Sequence
import numpy as np import numpy as np
import paddle 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 .tensor.creation import _real_to_complex_dtype, _complex_to_real_dtype
from .fluid.framework import _in_legacy_dygraph, in_dygraph_mode from .fluid.framework import _in_legacy_dygraph, in_dygraph_mode
from . import _C_ops, _legacy_C_ops from . import _C_ops, _legacy_C_ops
......
...@@ -25,8 +25,7 @@ from paddle import in_dynamic_mode ...@@ -25,8 +25,7 @@ from paddle import in_dynamic_mode
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from ...fluid.framework import _non_static_mode, _in_legacy_dygraph, in_dygraph_mode 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 ...fluid.data_feeder import check_variable_and_dtype, check_type
from ...framework import core from ...framework import core, convert_np_dtype_to_dtype_
from ...common_ops_import import convert_np_dtype_to_dtype_
__all__ = [] __all__ = []
......
...@@ -12,11 +12,9 @@ ...@@ -12,11 +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.
from typing import Optional
import paddle 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 .fft import fft_r2c, fft_c2r, fft_c2c
from .fluid.data_feeder import check_variable_and_dtype from .fluid.data_feeder import check_variable_and_dtype
from .fluid.framework import _non_static_mode from .fluid.framework import _non_static_mode
......
...@@ -29,8 +29,6 @@ import collections ...@@ -29,8 +29,6 @@ import collections
import string import string
import opt_einsum import opt_einsum
from paddle.common_ops_import import dygraph_only
__all__ = [] __all__ = []
......
...@@ -25,7 +25,6 @@ from .creation import full ...@@ -25,7 +25,6 @@ from .creation import full
import paddle import paddle
import warnings import warnings
from paddle.common_ops_import import core
from paddle.common_ops_import import VarDesc from paddle.common_ops_import import VarDesc
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
......
...@@ -18,7 +18,6 @@ import numpy as np ...@@ -18,7 +18,6 @@ import numpy as np
from paddle.common_ops_import import VarDesc from paddle.common_ops_import import VarDesc
from paddle.common_ops_import import dygraph_only 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 templatedoc
from paddle.common_ops_import import dygraph_utils from paddle.common_ops_import import dygraph_utils
......
...@@ -13,12 +13,11 @@ ...@@ -13,12 +13,11 @@
# limitations under the License. # limitations under the License.
import numpy as np import numpy as np
import paddle 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.data_feeder import check_variable_and_dtype, check_type, check_dtype
from ..fluid import layers from ..fluid import layers
from ..framework import core, in_dygraph_mode, _non_static_mode from ..framework import core, in_dygraph_mode, _non_static_mode
from ..fluid.framework import _in_legacy_dygraph 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 Variable
from paddle.common_ops_import import VarDesc from paddle.common_ops_import import VarDesc
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册