未验证 提交 e4dcc906 编写于 作者: S Shuangchi He 提交者: GitHub

[CodeStyle][F401] remove unused imports in...

[CodeStyle][F401] remove unused imports in python_paddle/nn_tensor_reader_tests_distributed_distribution_dataset_utils. (#46721)
上级 35674c30
...@@ -27,7 +27,6 @@ images per class. ...@@ -27,7 +27,6 @@ images per class.
""" """
import itertools
import numpy import numpy
import paddle.dataset.common import paddle.dataset.common
import paddle.utils.deprecated as deprecated import paddle.utils.deprecated as deprecated
......
...@@ -17,7 +17,6 @@ import hashlib ...@@ -17,7 +17,6 @@ import hashlib
import os import os
import errno import errno
import shutil import shutil
import six
import sys import sys
import importlib import importlib
import paddle.dataset import paddle.dataset
...@@ -55,7 +54,6 @@ def must_mkdirs(path): ...@@ -55,7 +54,6 @@ def must_mkdirs(path):
except OSError as exc: except OSError as exc:
if exc.errno != errno.EEXIST: if exc.errno != errno.EEXIST:
raise raise
pass
must_mkdirs(DATA_HOME) must_mkdirs(DATA_HOME)
......
...@@ -22,7 +22,6 @@ to initialize SRL model. ...@@ -22,7 +22,6 @@ to initialize SRL model.
import tarfile import tarfile
import gzip import gzip
import itertools
import paddle.dataset.common import paddle.dataset.common
import paddle.compat as cpt import paddle.compat as cpt
import paddle.utils.deprecated as deprecated import paddle.utils.deprecated as deprecated
......
...@@ -29,24 +29,16 @@ http://www.robots.ox.ac.uk/~vgg/publications/papers/nilsback08.{pdf,ps.gz}. ...@@ -29,24 +29,16 @@ http://www.robots.ox.ac.uk/~vgg/publications/papers/nilsback08.{pdf,ps.gz}.
""" """
import itertools
import functools import functools
from .common import download from .common import download
import tarfile import tarfile
from paddle.dataset.image import load_image_bytes from paddle.dataset.image import load_image_bytes
from paddle.dataset.image import load_image
from paddle.dataset.image import simple_transform from paddle.dataset.image import simple_transform
from paddle.dataset.image import batch_images_from_tar
from paddle.reader import map_readers, xmap_readers from paddle.reader import map_readers, xmap_readers
from paddle import compat as cpt
import paddle.utils.deprecated as deprecated import paddle.utils.deprecated as deprecated
import os
import numpy as np
from multiprocessing import cpu_count from multiprocessing import cpu_count
import six
from six.moves import cPickle as pickle
from paddle.utils import try_import from paddle.utils import try_import
__all__ = [] __all__ = []
......
...@@ -27,7 +27,6 @@ import zipfile ...@@ -27,7 +27,6 @@ import zipfile
import paddle.dataset.common import paddle.dataset.common
import paddle.utils.deprecated as deprecated import paddle.utils.deprecated as deprecated
import re import re
import random
import functools import functools
import six import six
import paddle.compat as cpt import paddle.compat as cpt
......
...@@ -22,7 +22,6 @@ parse training set and test set into paddle reader creators. ...@@ -22,7 +22,6 @@ parse training set and test set into paddle reader creators.
import six import six
import tarfile import tarfile
import gzip
import paddle.dataset.common import paddle.dataset.common
import paddle.compat as cpt import paddle.compat as cpt
......
...@@ -31,7 +31,6 @@ Multi30K: Multilingual English-German Image Descriptions. ...@@ -31,7 +31,6 @@ Multi30K: Multilingual English-German Image Descriptions.
import os import os
import six import six
import tarfile import tarfile
import gzip
from collections import defaultdict from collections import defaultdict
import paddle import paddle
......
...@@ -12,21 +12,13 @@ ...@@ -12,21 +12,13 @@
# 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 math
import warnings
import numpy as np import numpy as np
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.distribution import distribution from paddle.distribution import distribution
from paddle.fluid import core from paddle.fluid.data_feeder import (check_type, convert_dtype)
from paddle.fluid.data_feeder import (check_dtype, check_type, from paddle.fluid.framework import _non_static_mode
check_variable_and_dtype, convert_dtype) from paddle.fluid.layers import (ops, tensor)
from paddle.fluid.framework import _non_static_mode, in_dygraph_mode from paddle.tensor import multinomial
from paddle.fluid.layers import (control_flow, elementwise_add, elementwise_div,
elementwise_mul, elementwise_sub, nn, ops,
tensor)
from paddle.tensor import arange, concat, gather_nd, multinomial
class Categorical(distribution.Distribution): class Categorical(distribution.Distribution):
......
...@@ -19,20 +19,14 @@ ...@@ -19,20 +19,14 @@
# 'sampling_id', # 'sampling_id',
# 'Uniform'] # 'Uniform']
import math
import warnings import warnings
import numpy as np import numpy as np
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle.fluid import core from paddle.fluid.data_feeder import (check_variable_and_dtype, convert_dtype)
from paddle.fluid.data_feeder import (check_dtype, check_type,
check_variable_and_dtype, convert_dtype)
from paddle.fluid.framework import _non_static_mode, in_dygraph_mode, _in_legacy_dygraph from paddle.fluid.framework import _non_static_mode, in_dygraph_mode, _in_legacy_dygraph
from paddle.fluid.layers import (control_flow, elementwise_add, elementwise_div, from paddle.fluid.layers import tensor
elementwise_mul, elementwise_sub, nn, ops,
tensor)
from paddle.tensor import arange, concat, gather_nd, multinomial
class Distribution(object): class Distribution(object):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import paddle import paddle
from paddle.distribution import distribution from paddle.distribution import distribution
from paddle.fluid.framework import _non_static_mode, in_dygraph_mode from paddle.fluid.framework import _non_static_mode
class ExponentialFamily(distribution.Distribution): class ExponentialFamily(distribution.Distribution):
......
...@@ -24,7 +24,7 @@ from paddle.distribution.normal import Normal ...@@ -24,7 +24,7 @@ from paddle.distribution.normal import Normal
from paddle.distribution.lognormal import LogNormal from paddle.distribution.lognormal import LogNormal
from paddle.distribution.uniform import Uniform from paddle.distribution.uniform import Uniform
from paddle.distribution.laplace import Laplace from paddle.distribution.laplace import Laplace
from paddle.fluid.framework import _non_static_mode, in_dygraph_mode from paddle.fluid.framework import _non_static_mode
__all__ = ["register_kl", "kl_divergence"] __all__ = ["register_kl", "kl_divergence"]
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +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 collections
import paddle import paddle
from paddle.distribution import categorical, distribution from paddle.distribution import categorical, distribution
try: try:
......
...@@ -13,19 +13,13 @@ ...@@ -13,19 +13,13 @@
# limitations under the License. # limitations under the License.
import math import math
import warnings
import numpy as np import numpy as np
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.distribution import distribution from paddle.distribution import distribution
from paddle.fluid import core from paddle.fluid.data_feeder import (check_type, convert_dtype)
from paddle.fluid.data_feeder import (check_dtype, check_type, from paddle.fluid.framework import _non_static_mode
check_variable_and_dtype, convert_dtype) from paddle.fluid.layers import (elementwise_add, elementwise_div,
from paddle.fluid.framework import _non_static_mode, in_dygraph_mode elementwise_sub, nn, ops, tensor)
from paddle.fluid.layers import (control_flow, elementwise_add, elementwise_div,
elementwise_mul, elementwise_sub, nn, ops,
tensor)
try: try:
from collections.abc import Iterable from collections.abc import Iterable
except: except:
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import enum import enum
import functools import functools
import math import math
import numbers
import operator import operator
import typing import typing
......
...@@ -12,20 +12,13 @@ ...@@ -12,20 +12,13 @@
# 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 math
import warnings
import numpy as np import numpy as np
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle.distribution import distribution from paddle.distribution import distribution
from paddle.fluid import core from paddle.fluid.data_feeder import (check_type, convert_dtype)
from paddle.fluid.data_feeder import (check_dtype, check_type,
check_variable_and_dtype, convert_dtype)
from paddle.fluid.framework import _non_static_mode, in_dygraph_mode, _in_legacy_dygraph from paddle.fluid.framework import _non_static_mode, in_dygraph_mode, _in_legacy_dygraph
from paddle.fluid.layers import (control_flow, elementwise_add, elementwise_div, from paddle.fluid.layers import (elementwise_add, elementwise_div,
elementwise_mul, elementwise_sub, nn, ops, elementwise_sub, nn, tensor)
tensor)
from paddle.tensor import arange, concat, gather_nd, multinomial
class Uniform(distribution.Distribution): class Uniform(distribution.Distribution):
......
...@@ -18,12 +18,10 @@ from ...tensor.math import tanh_ # noqa: F401 ...@@ -18,12 +18,10 @@ from ...tensor.math import tanh_ # noqa: F401
from ...fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only from ...fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only
from ...tensor.manipulation import chunk from ...tensor.manipulation import chunk
from ...tensor.math import multiply
import warnings
from ...fluid.layer_helper import LayerHelper from ...fluid.layer_helper import LayerHelper
from ...fluid.framework import convert_np_dtype_to_dtype_ from ...fluid.framework import convert_np_dtype_to_dtype_
from ...fluid.framework import _in_legacy_dygraph, in_dygraph_mode, _non_static_mode from ...fluid.framework import _in_legacy_dygraph, in_dygraph_mode
from ...fluid.data_feeder import check_variable_and_dtype, check_dtype from ...fluid.data_feeder import check_variable_and_dtype, check_dtype
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops, in_dynamic_mode from paddle import _C_ops, _legacy_C_ops, in_dynamic_mode
......
...@@ -12,14 +12,12 @@ ...@@ -12,14 +12,12 @@
# 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 warnings
import paddle import paddle
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.layers.tensor import fill_constant from paddle.fluid.layers.tensor import fill_constant
from ...tensor import concat from ...tensor import concat
from ...tensor.creation import zeros from ...tensor.creation import zeros
from paddle.static import Variable from paddle.static import Variable
from ...fluid import dygraph_utils
# TODO: define the common functions to build a neural network # TODO: define the common functions to build a neural network
from ...tensor.manipulation import squeeze from ...tensor.manipulation import squeeze
from ...tensor.manipulation import unsqueeze from ...tensor.manipulation import unsqueeze
...@@ -27,9 +25,7 @@ from ...tensor import clip ...@@ -27,9 +25,7 @@ from ...tensor import clip
from ...tensor import sum from ...tensor import sum
from ...tensor import sqrt from ...tensor import sqrt
from ...fluid.data_feeder import check_variable_and_dtype, check_dtype, check_type from ...fluid.data_feeder import check_variable_and_dtype, check_dtype, check_type
from ...fluid.framework import _varbase_creator, _in_legacy_dygraph, in_dygraph_mode, _non_static_mode from ...fluid.framework import _in_legacy_dygraph, _non_static_mode, in_dygraph_mode
from ...fluid import dygraph_utils
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle.framework import in_dynamic_mode from paddle.framework import in_dynamic_mode
......
...@@ -12,16 +12,12 @@ ...@@ -12,16 +12,12 @@
# 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 numpy as np
from ...device import get_cudnn_version from ...device import get_cudnn_version
from ...static import Variable from ...static import Variable
from ...fluid import dygraph_utils
from ...fluid.layers.utils import convert_to_list, _is_symmetric_padding, _contain_var, _convert_to_tensor_list from ...fluid.layers.utils import convert_to_list, _is_symmetric_padding, _contain_var, _convert_to_tensor_list
from ...fluid.data_feeder import check_variable_and_dtype, check_dtype from ...fluid.data_feeder import check_variable_and_dtype, check_dtype
from ...framework import ParamAttr
from ...fluid.layer_helper import LayerHelper from ...fluid.layer_helper import LayerHelper
from ...tensor.manipulation import unsqueeze, squeeze from ...tensor.manipulation import unsqueeze, squeeze
from ...tensor.math import add
from ...fluid.layers import nn from ...fluid.layers import nn
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle import get_flags from paddle import get_flags
...@@ -34,7 +30,6 @@ from paddle.device import is_compiled_with_rocm ...@@ -34,7 +30,6 @@ from paddle.device import is_compiled_with_rocm
from paddle.fluid.framework import _global_flags from paddle.fluid.framework import _global_flags
from paddle.fluid.framework import _in_legacy_dygraph from paddle.fluid.framework import _in_legacy_dygraph
from paddle.fluid.framework import in_dygraph_mode from paddle.fluid.framework import in_dygraph_mode
from paddle.fluid.framework import _non_static_mode
__all__ = [] __all__ = []
......
...@@ -19,7 +19,6 @@ from ...fluid.data_feeder import check_dtype ...@@ -19,7 +19,6 @@ from ...fluid.data_feeder import check_dtype
from ...fluid.layer_helper import LayerHelper from ...fluid.layer_helper import LayerHelper
from ...static import Variable from ...static import Variable
from ...tensor.creation import assign from ...tensor.creation import assign
from ...fluid import dygraph_utils
from ...tensor.layer_function_generator import templatedoc from ...tensor.layer_function_generator import templatedoc
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
......
...@@ -12,12 +12,10 @@ ...@@ -12,12 +12,10 @@
# 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 warnings
from ...static import Variable from ...static import Variable
from ...fluid.layer_helper import LayerHelper from ...fluid.layer_helper import LayerHelper
from ...fluid.data_feeder import check_variable_and_dtype, check_dtype from ...fluid.data_feeder import check_variable_and_dtype
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle import in_dynamic_mode
from ...fluid.framework import _in_legacy_dygraph, in_dygraph_mode from ...fluid.framework import _in_legacy_dygraph, in_dygraph_mode
__all__ = [] __all__ = []
......
...@@ -17,7 +17,6 @@ import paddle ...@@ -17,7 +17,6 @@ import paddle
from ...fluid.data_feeder import check_variable_and_dtype from ...fluid.data_feeder import check_variable_and_dtype
# TODO: define loss functions of neural network # TODO: define loss functions of neural network
import numpy as np
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from ...fluid.layers.nn import _elementwise_op_in_dygraph from ...fluid.layers.nn import _elementwise_op_in_dygraph
......
...@@ -17,14 +17,11 @@ import paddle ...@@ -17,14 +17,11 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from ...fluid.data_feeder import check_variable_and_dtype, check_type from ...fluid.data_feeder import check_variable_and_dtype, check_type
from ...fluid.layer_helper import LayerHelper from ...fluid.layer_helper import LayerHelper
from ...framework import create_parameter
from ..initializer import Constant
from ...framework import ParamAttr
from ...fluid import dygraph_utils from ...fluid import dygraph_utils
import numbers import numbers
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
from paddle.fluid.framework import core, _non_static_mode, in_dygraph_mode, _in_legacy_dygraph from paddle.fluid.framework import _in_legacy_dygraph, in_dygraph_mode
__all__ = [] __all__ = []
......
...@@ -18,7 +18,6 @@ from ...tensor.manipulation import unsqueeze, squeeze ...@@ -18,7 +18,6 @@ from ...tensor.manipulation import unsqueeze, squeeze
from ...fluid.data_feeder import check_type, check_variable_and_dtype from ...fluid.data_feeder import check_type, check_variable_and_dtype
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
from paddle.fluid import core
from paddle.fluid.framework import _in_legacy_dygraph, Variable from paddle.fluid.framework import _in_legacy_dygraph, Variable
from paddle.fluid.framework import in_dygraph_mode, _non_static_mode from paddle.fluid.framework import in_dygraph_mode, _non_static_mode
......
...@@ -12,11 +12,8 @@ ...@@ -12,11 +12,8 @@
# 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 warnings
import paddle
from ...fluid.framework import default_main_program
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
from paddle import _C_ops, _legacy_C_ops from paddle import _legacy_C_ops
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
......
...@@ -16,8 +16,6 @@ from ...device import get_cudnn_version ...@@ -16,8 +16,6 @@ from ...device import get_cudnn_version
from ...static import Variable from ...static import Variable
from ...fluid.layer_helper import LayerHelper from ...fluid.layer_helper import LayerHelper
from ...fluid.data_feeder import check_variable_and_dtype from ...fluid.data_feeder import check_variable_and_dtype
from ...fluid import dygraph_utils
import numpy as np
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from ...device import is_compiled_with_rocm from ...device import is_compiled_with_rocm
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
......
...@@ -19,7 +19,7 @@ from ...fluid import framework ...@@ -19,7 +19,7 @@ from ...fluid import framework
from ...fluid.framework import _current_expected_place from ...fluid.framework import _current_expected_place
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
from paddle.utils import unique_name from paddle.utils import unique_name
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops
from ... import fluid from ... import fluid
__all__ = [] __all__ = []
......
...@@ -15,10 +15,9 @@ ...@@ -15,10 +15,9 @@
from ...fluid.initializer import Initializer from ...fluid.initializer import Initializer
from ...fluid.data_feeder import check_variable_and_dtype from ...fluid.data_feeder import check_variable_and_dtype
from ...fluid import framework from ...fluid import framework
from ...tensor import diag, transpose, sign, qr, reshape
from paddle.utils import unique_name from paddle.utils import unique_name
from ...fluid.dygraph import no_grad from ...fluid.dygraph import no_grad
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops
__all__ = [] __all__ = []
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
# TODO: define activation functions of neural network # TODO: define activation functions of neural network
from ...framework import ParamAttr
from ..initializer import Constant from ..initializer import Constant
from paddle.framework import get_default_dtype from paddle.framework import get_default_dtype
from .. import functional as F from .. import functional as F
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
import paddle import paddle
from ...fluid.dygraph import Flatten # noqa: F401 from ...fluid.dygraph import Flatten # noqa: F401
from .. import functional as F from .. import functional as F
from ...fluid.framework import _dygraph_tracer
from paddle.nn import Layer from paddle.nn import Layer
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
......
...@@ -14,11 +14,10 @@ ...@@ -14,11 +14,10 @@
# limitations under the License. # limitations under the License.
# TODO: define loss functions of neural network # TODO: define loss functions of neural network
import numpy as np
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle import paddle
from .. import functional as F from .. import functional as F
from paddle.fluid.framework import _varbase_creator, in_dygraph_mode, _in_legacy_dygraph from paddle.fluid.framework import in_dygraph_mode
from .. import Layer from .. import Layer
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
......
...@@ -27,16 +27,14 @@ ...@@ -27,16 +27,14 @@
# TODO: define normalization api # TODO: define normalization api
import six
from ...fluid.dygraph import BatchNorm # noqa: F401 from ...fluid.dygraph import BatchNorm # noqa: F401
from ...fluid.dygraph import SpectralNorm # noqa: F401 from ...fluid.dygraph import SpectralNorm # noqa: F401
from ...framework import get_default_dtype, set_default_dtype, _non_static_mode from ...framework import get_default_dtype
from ..initializer import Constant from ..initializer import Constant
from ...framework import ParamAttr from ...framework import ParamAttr
from ...fluid.data_feeder import check_variable_and_dtype, check_type from ...fluid.data_feeder import check_variable_and_dtype
from ...fluid import dygraph_utils from ...fluid import dygraph_utils
from ..functional import batch_norm, layer_norm, instance_norm from ..functional import batch_norm, layer_norm, instance_norm
......
...@@ -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.
from ...fluid.layer_helper import LayerHelper
from .. import functional as F from .. import functional as F
from .. import Layer from .. import Layer
......
...@@ -12,26 +12,19 @@ ...@@ -12,26 +12,19 @@
# 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 copy
import collections
import itertools
import six import six
import math import math
import sys import sys
import warnings from functools import reduce
from functools import partial, reduce
import numpy as np import numpy as np
import paddle import paddle
import paddle.fluid as fluid
from paddle import framework from paddle import framework
from paddle.device import get_device, get_cudnn_version
from paddle.nn import functional as F from paddle.nn import functional as F
from paddle.nn import initializer as I from paddle.nn import initializer as I
from paddle.nn import Layer, LayerList from paddle.nn import Layer, LayerList
from paddle.fluid.layers import utils from paddle.fluid.layers import utils
from paddle.fluid.layers.utils import map_structure, flatten, pack_sequence_as from paddle.fluid.layers.utils import flatten, map_structure
from paddle.fluid.data_feeder import convert_dtype
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
from paddle.fluid.framework import in_dygraph_mode from paddle.fluid.framework import in_dygraph_mode
......
...@@ -13,21 +13,12 @@ ...@@ -13,21 +13,12 @@
# limitations under the License. # limitations under the License.
import paddle import paddle
from paddle.framework import core
from paddle.fluid import dygraph_utils
from paddle.utils import unique_name from paddle.utils import unique_name
from paddle.framework import ParamAttr from paddle.framework import ParamAttr
from paddle.fluid.framework import _varbase_creator
from paddle.nn.initializer import Constant from paddle.nn.initializer import Constant
from paddle.fluid.data_feeder import check_variable_and_dtype
from paddle.nn import functional as F
import logging
from paddle.fluid.log_helper import get_logger
from paddle import in_dynamic_mode
from paddle.nn import Layer from paddle.nn import Layer
from paddle.autograd import PyLayer from paddle.autograd import PyLayer
import math import math
import copy
def round(x): def round(x):
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import paddle import paddle
from paddle.framework import core from paddle.framework import core
from paddle.fluid import dygraph_utils
from paddle.utils import unique_name from paddle.utils import unique_name
from paddle.framework import ParamAttr from paddle.framework import ParamAttr
from paddle.fluid.framework import _varbase_creator from paddle.fluid.framework import _varbase_creator
...@@ -23,7 +22,7 @@ from paddle.fluid.data_feeder import check_variable_and_dtype ...@@ -23,7 +22,7 @@ from paddle.fluid.data_feeder import check_variable_and_dtype
from paddle.nn import functional as F from paddle.nn import functional as F
import logging import logging
from paddle.fluid.log_helper import get_logger from paddle.fluid.log_helper import get_logger
from paddle import _C_ops, _legacy_C_ops from paddle import _legacy_C_ops
from paddle import in_dynamic_mode from paddle import in_dynamic_mode
from paddle.nn import Layer from paddle.nn import Layer
from paddle.nn.quant.lsq import FakeQuantActLSQPlus, FakeQuantWeightLSQPlus from paddle.nn.quant.lsq import FakeQuantActLSQPlus, FakeQuantWeightLSQPlus
......
...@@ -12,9 +12,6 @@ ...@@ -12,9 +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 math
import numpy as np
import paddle import paddle
from ..layer.conv import Conv1DTranspose, Conv2DTranspose, Conv3DTranspose from ..layer.conv import Conv1DTranspose, Conv2DTranspose, Conv3DTranspose
from ..layer.common import Linear from ..layer.common import Linear
......
...@@ -16,7 +16,7 @@ from functools import reduce ...@@ -16,7 +16,7 @@ from functools import reduce
import paddle import paddle
from paddle.fluid.framework import dygraph_only, _dygraph_tracer, _varbase_creator, in_dygraph_mode from paddle.fluid.framework import dygraph_only, _dygraph_tracer, _varbase_creator, in_dygraph_mode
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops
#input==output, inplace strategy of reshape has no cost almostly #input==output, inplace strategy of reshape has no cost almostly
......
...@@ -12,14 +12,11 @@ ...@@ -12,14 +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 paddle import paddle
import numpy as np
from ... import fluid
from ...fluid import dygraph
from ...fluid import layers as F from ...fluid import layers as F
from ...fluid.layer_helper import LayerHelper from ...fluid.layer_helper import LayerHelper
from ...fluid.data_feeder import check_variable_and_dtype from ...fluid.data_feeder import check_variable_and_dtype
from ...framework import in_dygraph_mode from ...framework import in_dygraph_mode
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops
__all__ = [] __all__ = []
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
from threading import Thread from threading import Thread
import subprocess
import multiprocessing import multiprocessing
import six import six
import sys import sys
...@@ -26,9 +25,7 @@ from six.moves import map ...@@ -26,9 +25,7 @@ from six.moves import map
from six.moves import zip from six.moves import zip
import itertools import itertools
import random import random
import zlib
import paddle.compat as cpt
from paddle.fluid.reader import QUEUE_GET_TIMEOUT from paddle.fluid.reader import QUEUE_GET_TIMEOUT
__all__ = [] __all__ = []
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
# Define functions about array. # Define functions about array.
import paddle
from ..static import Variable from ..static import Variable
from ..framework import LayerHelper, core, _non_static_mode from ..framework import LayerHelper, core, _non_static_mode
from ..fluid.data_feeder import check_type from ..fluid.data_feeder import check_type
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# 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 ..framework import core, _non_static_mode from ..framework import core
from ..framework import LayerHelper from ..framework import LayerHelper
from ..fluid.data_feeder import check_variable_and_dtype from ..fluid.data_feeder import check_variable_and_dtype
from ..fluid.data_feeder import check_type from ..fluid.data_feeder import check_type
......
...@@ -19,12 +19,11 @@ from paddle.common_ops_import import fill_constant ...@@ -19,12 +19,11 @@ from paddle.common_ops_import import fill_constant
from ..fluid.layers import utils from ..fluid.layers import utils
from ..static import Variable, device_guard from ..static import Variable, device_guard
from ..framework import _current_expected_place, _get_paddle_place from ..framework import _current_expected_place, _get_paddle_place
from ..framework import dygraph_only
from ..framework import core from ..framework import core
from ..framework import in_dygraph_mode, _non_static_mode from ..framework import in_dygraph_mode, _non_static_mode
from ..framework import LayerHelper from ..framework import LayerHelper
from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype, convert_dtype from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype, convert_dtype
from ..framework import convert_np_dtype_to_dtype_, _varbase_creator, OpProtoHolder from ..framework import convert_np_dtype_to_dtype_
# TODO: define functions to get create a tensor # TODO: define functions to get create a tensor
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
......
...@@ -16,15 +16,15 @@ import itertools ...@@ -16,15 +16,15 @@ import itertools
import numpy as np import numpy as np
import re import re
from .linalg import dot, matmul, transpose from .linalg import matmul, transpose
from .manipulation import squeeze, unsqueeze, reshape from .manipulation import squeeze, unsqueeze, reshape
from .math import multiply from .math import multiply
from .math import sum as paddle_sum from .math import sum as paddle_sum
from ..fluid.framework import _in_legacy_dygraph from ..fluid.framework import _in_legacy_dygraph
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype from ..fluid.data_feeder import check_type, check_variable_and_dtype
from ..fluid.layer_helper import LayerHelper from ..fluid.layer_helper import LayerHelper
from ..fluid.framework import _non_static_mode, in_dygraph_mode, _in_legacy_dygraph from ..fluid.framework import _in_legacy_dygraph, in_dygraph_mode
import collections import collections
import string import string
import opt_einsum import opt_einsum
......
...@@ -13,17 +13,15 @@ ...@@ -13,17 +13,15 @@
# limitations under the License. # limitations under the License.
import re import re
import functools
import warnings import warnings
import string import string
from six.moves import cStringIO from six.moves import cStringIO
from ..static import Variable from ..static import Variable
from ..fluid.proto import framework_pb2 from ..fluid.proto import framework_pb2
from ..framework import OpProtoHolder, core, convert_np_dtype_to_dtype_, _non_static_mode, in_dygraph_mode, _in_legacy_dygraph from ..framework import OpProtoHolder, _non_static_mode, convert_np_dtype_to_dtype_, core, in_dygraph_mode
from ..framework import LayerHelper from ..framework import LayerHelper
from ..fluid.data_feeder import check_variable_and_dtype from ..fluid.data_feeder import check_variable_and_dtype
import paddle
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
__all__ = [] __all__ = []
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import numpy as np import numpy as np
from ..framework import LayerHelper from ..framework import LayerHelper
from ..framework import _varbase_creator, _dygraph_tracer, in_dygraph_mode, _non_static_mode from ..framework import _non_static_mode, in_dygraph_mode
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 ..static import Variable from ..static import Variable
from ..fluid.framework import _in_legacy_dygraph from ..fluid.framework import _in_legacy_dygraph
...@@ -24,7 +24,6 @@ from .logic import logical_not ...@@ -24,7 +24,6 @@ from .logic import logical_not
from .creation import full from .creation import full
import paddle import paddle
import warnings
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
......
...@@ -23,7 +23,7 @@ if _in_eager_mode_: ...@@ -23,7 +23,7 @@ if _in_eager_mode_:
else: else:
from ..framework import VarBase as Tensor from ..framework import VarBase as Tensor
from ..framework import in_dygraph_mode, _non_static_mode from ..framework import in_dygraph_mode
from ..framework import LayerHelper from ..framework import LayerHelper
from ..fluid.framework import _in_legacy_dygraph from ..fluid.framework import _in_legacy_dygraph
# TODO: define logic functions of a tensor # TODO: define logic functions of a tensor
......
...@@ -14,16 +14,15 @@ ...@@ -14,16 +14,15 @@
from collections import Counter from collections import Counter
from ..static import Variable, device_guard from ..static import Variable
from ..framework import core, in_dygraph_mode from ..framework import core, in_dygraph_mode
from ..fluid.framework import _in_legacy_dygraph, _in_eager_without_dygraph_check, _non_static_mode from ..fluid.framework import _in_legacy_dygraph, _non_static_mode
from ..framework import LayerHelper from ..framework import LayerHelper
from ..framework import OpProtoHolder, convert_np_dtype_to_dtype_, dygraph_only from ..framework import convert_np_dtype_to_dtype_, dygraph_only
from ..fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype from ..fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype
from ..fluid.layers import utils from ..fluid.layers import utils
import numpy as np import numpy as np
# TODO: define functions to manipulate a tensor # TODO: define functions to manipulate a tensor
from ..fluid.layers.nn import _elementwise_op_in_dygraph
from ..fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only from ..fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
......
...@@ -23,7 +23,7 @@ from paddle.common_ops_import import dygraph_utils ...@@ -23,7 +23,7 @@ from paddle.common_ops_import import dygraph_utils
from .manipulation import cast from .manipulation import cast
from .creation import _complex_to_real_dtype from .creation import _complex_to_real_dtype
from .layer_function_generator import _generate_doc_string_, generate_activation_fn, generate_layer_fn from .layer_function_generator import generate_layer_fn
import paddle import paddle
from ..static import Variable from ..static import Variable
......
...@@ -12,14 +12,9 @@ ...@@ -12,14 +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
from .layer_function_generator import generate_layer_fn, generate_activation_fn, generate_inplace_fn, add_sample_code from .layer_function_generator import generate_layer_fn, generate_activation_fn, generate_inplace_fn, add_sample_code
from ..framework import core
from ..framework import convert_np_dtype_to_dtype_
from ..static import Variable
from ..fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype
from ..fluid.framework import in_dygraph_mode from ..fluid.framework import in_dygraph_mode
from .. import _C_ops, _legacy_C_ops from .. import _C_ops
__deprecated_func_name__ = { __deprecated_func_name__ = {
'tanh_shrink': 'tanhshrink', 'tanh_shrink': 'tanhshrink',
......
...@@ -14,14 +14,12 @@ ...@@ -14,14 +14,12 @@
import numpy as np import numpy as np
import paddle import paddle
from ..framework import LayerHelper, convert_np_dtype_to_dtype_ 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_dtype, check_variable_and_dtype
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 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
from .logic import logical_not
# TODO: define searching & indexing functions of a tensor # TODO: define searching & indexing functions of a tensor
# from ..fluid.layers import has_inf #DEFINE_ALIAS # from ..fluid.layers import has_inf #DEFINE_ALIAS
......
...@@ -14,13 +14,12 @@ ...@@ -14,13 +14,12 @@
# TODO: define statistical functions of a tensor # TODO: define statistical functions of a tensor
import numpy as np
from ..static import Variable from ..static import Variable
from ..framework import LayerHelper from ..framework import LayerHelper
from ..framework import core from ..framework import core
from paddle.fluid.framework import _in_legacy_dygraph, in_dygraph_mode from paddle.fluid.framework import _in_legacy_dygraph, in_dygraph_mode
from .search import where from .search import where
from ..fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype from ..fluid.data_feeder import check_type, check_variable_and_dtype
from ..fluid.layers import utils from ..fluid.layers import utils
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
......
...@@ -12,10 +12,9 @@ ...@@ -12,10 +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 paddle
import numpy as np import numpy as np
from ..framework import core from ..framework import core
from paddle.fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype from paddle.fluid.data_feeder import check_type, convert_dtype
__all__ = [] __all__ = []
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import numpy as np import numpy as np
import contextlib
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import unittest import unittest
import numpy as np import numpy as np
import contextlib
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
......
...@@ -22,7 +22,6 @@ from paddle.vision.datasets import MNIST ...@@ -22,7 +22,6 @@ from paddle.vision.datasets import MNIST
from paddle.vision.models import LeNet from paddle.vision.models import LeNet
import paddle.static.amp as amp import paddle.static.amp as amp
import random import random
from paddle import callbacks
import argparse import argparse
import ast import ast
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
dependencies = ['paddle'] dependencies = ['paddle']
import paddle
from test_hapi_hub_model import MM as _MM from test_hapi_hub_model import MM as _MM
......
...@@ -15,7 +15,6 @@ import unittest ...@@ -15,7 +15,6 @@ import unittest
import librosa import librosa
import numpy as np import numpy as np
import os
import paddle import paddle
import paddle.audio import paddle.audio
......
...@@ -15,12 +15,10 @@ import unittest ...@@ -15,12 +15,10 @@ import unittest
import librosa import librosa
import numpy as np import numpy as np
import os
import paddle import paddle
import paddle.audio import paddle.audio
import scipy import scipy
from scipy import signal
import itertools import itertools
from parameterized import parameterized from parameterized import parameterized
......
...@@ -15,11 +15,9 @@ import unittest ...@@ -15,11 +15,9 @@ import unittest
import librosa import librosa
import numpy as np import numpy as np
import os
import paddle import paddle
import paddle.audio import paddle.audio
from scipy import signal
import itertools import itertools
from parameterized import parameterized from parameterized import parameterized
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import time
import random
import tempfile import tempfile
import shutil import shutil
import numpy as np import numpy as np
...@@ -23,7 +21,6 @@ import paddle ...@@ -23,7 +21,6 @@ import paddle
from paddle import Model from paddle import Model
from paddle.static import InputSpec from paddle.static import InputSpec
from paddle.vision.models import LeNet from paddle.vision.models import LeNet
from paddle.hapi.callbacks import config_callbacks
from paddle.vision.datasets import MNIST from paddle.vision.datasets import MNIST
from paddle.metric import Accuracy from paddle.metric import Accuracy
from paddle.nn.layer.loss import CrossEntropyLoss from paddle.nn.layer.loss import CrossEntropyLoss
......
...@@ -12,24 +12,17 @@ ...@@ -12,24 +12,17 @@
# 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 sys
import unittest import unittest
import time
import random
import tempfile
import shutil
import numpy as np
import paddle import paddle
import paddle.vision.transforms as T import paddle.vision.transforms as T
from paddle import Model from paddle import Model
from paddle.static import InputSpec from paddle.static import InputSpec
from paddle.vision.models import LeNet from paddle.vision.models import LeNet
from paddle.hapi.callbacks import config_callbacks
from paddle.vision.datasets import MNIST from paddle.vision.datasets import MNIST
from paddle.metric import Accuracy from paddle.metric import Accuracy
from paddle.nn.layer.loss import CrossEntropyLoss from paddle.nn.layer.loss import CrossEntropyLoss
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph from paddle.fluid.framework import _test_eager_guard
# Accelerate unittest # Accelerate unittest
......
...@@ -14,22 +14,14 @@ ...@@ -14,22 +14,14 @@
import sys import sys
import unittest import unittest
import time
import random
import tempfile import tempfile
import shutil import shutil
import numpy as np
import paddle import paddle
from paddle import Model
from paddle.static import InputSpec from paddle.static import InputSpec
from paddle.vision.models import LeNet
from paddle.hapi.callbacks import config_callbacks
import paddle.vision.transforms as T import paddle.vision.transforms as T
from paddle.vision.datasets import MNIST from paddle.vision.datasets import MNIST
from paddle.metric import Accuracy from paddle.fluid.framework import _test_eager_guard
from paddle.nn.layer.loss import CrossEntropyLoss
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph
class MnistDataset(MNIST): class MnistDataset(MNIST):
......
...@@ -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 sys
import unittest import unittest
import time import time
import random import random
...@@ -20,15 +19,11 @@ import tempfile ...@@ -20,15 +19,11 @@ import tempfile
import shutil import shutil
import numpy as np import numpy as np
import paddle
from paddle import Model from paddle import Model
from paddle.static import InputSpec from paddle.static import InputSpec
from paddle.vision.models import LeNet from paddle.vision.models import LeNet
from paddle.hapi.callbacks import config_callbacks from paddle.hapi.callbacks import config_callbacks
import paddle.vision.transforms as T
from paddle.vision.datasets import MNIST from paddle.vision.datasets import MNIST
from paddle.metric import Accuracy
from paddle.nn.layer.loss import CrossEntropyLoss
class MnistDataset(MNIST): class MnistDataset(MNIST):
......
...@@ -13,11 +13,7 @@ ...@@ -13,11 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import os
import numpy as np import numpy as np
import tempfile
import shutil
import cv2
from paddle.text.datasets import UCIHousing, WMT14 from paddle.text.datasets import UCIHousing, WMT14
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import os
import numpy as np import numpy as np
from paddle.vision.datasets import voc2012, VOC2012 from paddle.vision.datasets import voc2012, VOC2012
......
...@@ -22,7 +22,7 @@ import cv2 ...@@ -22,7 +22,7 @@ import cv2
import paddle.vision.transforms as T import paddle.vision.transforms as T
from paddle.vision.datasets import DatasetFolder, ImageFolder, MNIST, FashionMNIST, Flowers from paddle.vision.datasets import DatasetFolder, ImageFolder, MNIST, FashionMNIST, Flowers
from paddle.dataset.common import _check_exists_and_download from paddle.dataset.common import _check_exists_and_download
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph from paddle.fluid.framework import _test_eager_guard
class TestFolderDatasets(unittest.TestCase): class TestFolderDatasets(unittest.TestCase):
......
...@@ -18,7 +18,7 @@ import numpy as np ...@@ -18,7 +18,7 @@ import numpy as np
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
from paddle.fluid.framework import _test_eager_guard, in_dygraph_mode from paddle.fluid.framework import _test_eager_guard
class TestDLPack(unittest.TestCase): class TestDLPack(unittest.TestCase):
......
...@@ -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 paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import unittest import unittest
import os import os
import numpy as np
import shutil import shutil
import tempfile import tempfile
......
...@@ -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 os
import unittest import unittest
import numpy as np import numpy as np
......
...@@ -22,7 +22,7 @@ import tempfile ...@@ -22,7 +22,7 @@ import tempfile
import paddle import paddle
from paddle import fluid from paddle import fluid
from paddle import to_tensor from paddle import to_tensor
from paddle.nn import Conv2D, Linear, ReLU, Sequential, Softmax from paddle.nn import Conv2D, Linear, ReLU, Sequential
from paddle import Model from paddle import Model
from paddle.static import InputSpec from paddle.static import InputSpec
...@@ -34,7 +34,6 @@ import paddle.vision.models as models ...@@ -34,7 +34,6 @@ import paddle.vision.models as models
import paddle.fluid.dygraph.jit as jit import paddle.fluid.dygraph.jit as jit
from paddle.io import DistributedBatchSampler, Dataset from paddle.io import DistributedBatchSampler, Dataset
from paddle.hapi.model import prepare_distributed_context from paddle.hapi.model import prepare_distributed_context
from paddle.fluid.dygraph.jit import declarative
from paddle.fluid.dygraph.dygraph_to_static.program_translator import ProgramTranslator from paddle.fluid.dygraph.dygraph_to_static.program_translator import ProgramTranslator
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import os import os
import cv2 import cv2
import shutil
import unittest import unittest
import tempfile import tempfile
import numpy as np import numpy as np
......
...@@ -21,7 +21,7 @@ import numpy as np ...@@ -21,7 +21,7 @@ import numpy as np
from PIL import Image from PIL import Image
import paddle import paddle
from paddle.vision import get_image_backend, set_image_backend, image_load from paddle.vision import image_load, set_image_backend
from paddle.vision.datasets import DatasetFolder from paddle.vision.datasets import DatasetFolder
from paddle.vision.transforms import transforms from paddle.vision.transforms import transforms
import paddle.vision.transforms.functional as F import paddle.vision.transforms.functional as F
......
...@@ -22,11 +22,11 @@ from setuptools.command.easy_install import easy_install ...@@ -22,11 +22,11 @@ from setuptools.command.easy_install import easy_install
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext
from distutils.command.build import build from distutils.command.build import build
from .extension_utils import find_cuda_home, find_rocm_home, normalize_extension_kwargs, add_compile_flag, run_cmd from .extension_utils import add_compile_flag, find_cuda_home, find_rocm_home, normalize_extension_kwargs
from .extension_utils import is_cuda_file, prepare_unix_cudaflags, prepare_win_cudaflags from .extension_utils import is_cuda_file, prepare_unix_cudaflags, prepare_win_cudaflags
from .extension_utils import _import_module_from_library, _write_setup_file, _jit_compile from .extension_utils import _import_module_from_library, _write_setup_file, _jit_compile
from .extension_utils import check_abi_compatibility, log_v, CustomOpInfo, parse_op_name_from from .extension_utils import check_abi_compatibility, log_v, CustomOpInfo, parse_op_name_from
from .extension_utils import clean_object_if_change_cflags, _reset_so_rpath, _get_fluid_path from .extension_utils import _reset_so_rpath, clean_object_if_change_cflags
from .extension_utils import bootstrap_context, get_build_directory, add_std_without_repeat from .extension_utils import bootstrap_context, get_build_directory, add_std_without_repeat
from .extension_utils import IS_WINDOWS, OS_NAME, MSVC_COMPILE_FLAGS, MSVC_COMPILE_FLAGS from .extension_utils import IS_WINDOWS, OS_NAME, MSVC_COMPILE_FLAGS, MSVC_COMPILE_FLAGS
......
...@@ -397,7 +397,6 @@ def _get_core_name(): ...@@ -397,7 +397,6 @@ def _get_core_name():
""" """
Return pybind DSO module name. Return pybind DSO module name.
""" """
import paddle
ext_name = '.pyd' if IS_WINDOWS else '.so' ext_name = '.pyd' if IS_WINDOWS else '.so'
return 'libpaddle' + ext_name return 'libpaddle' + ext_name
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import paddle import paddle
from ..fluid.core import LoDTensor from ..fluid.core import LoDTensor
from ..fluid.framework import _non_static_mode from ..fluid.framework import _non_static_mode
from ..fluid.data_feeder import check_type, check_dtype, convert_dtype from ..fluid.data_feeder import check_type
__all__ = [ __all__ = [
'to_dlpack', 'to_dlpack',
......
...@@ -22,7 +22,6 @@ import hashlib ...@@ -22,7 +22,6 @@ import hashlib
import tarfile import tarfile
import zipfile import zipfile
import time import time
from collections import OrderedDict
try: try:
from tqdm import tqdm from tqdm import tqdm
......
...@@ -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 os
import logging import logging
import numpy as np import numpy as np
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册