未验证 提交 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.
"""
import itertools
import numpy
import paddle.dataset.common
import paddle.utils.deprecated as deprecated
......
......@@ -17,7 +17,6 @@ import hashlib
import os
import errno
import shutil
import six
import sys
import importlib
import paddle.dataset
......@@ -55,7 +54,6 @@ def must_mkdirs(path):
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
pass
must_mkdirs(DATA_HOME)
......
......@@ -22,7 +22,6 @@ to initialize SRL model.
import tarfile
import gzip
import itertools
import paddle.dataset.common
import paddle.compat as cpt
import paddle.utils.deprecated as deprecated
......
......@@ -29,24 +29,16 @@ http://www.robots.ox.ac.uk/~vgg/publications/papers/nilsback08.{pdf,ps.gz}.
"""
import itertools
import functools
from .common import download
import tarfile
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 batch_images_from_tar
from paddle.reader import map_readers, xmap_readers
from paddle import compat as cpt
import paddle.utils.deprecated as deprecated
import os
import numpy as np
from multiprocessing import cpu_count
import six
from six.moves import cPickle as pickle
from paddle.utils import try_import
__all__ = []
......
......@@ -27,7 +27,6 @@ import zipfile
import paddle.dataset.common
import paddle.utils.deprecated as deprecated
import re
import random
import functools
import six
import paddle.compat as cpt
......
......@@ -22,7 +22,6 @@ parse training set and test set into paddle reader creators.
import six
import tarfile
import gzip
import paddle.dataset.common
import paddle.compat as cpt
......
......@@ -31,7 +31,6 @@ Multi30K: Multilingual English-German Image Descriptions.
import os
import six
import tarfile
import gzip
from collections import defaultdict
import paddle
......
......@@ -12,21 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import math
import warnings
import numpy as np
import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.distribution import distribution
from paddle.fluid import core
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
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
from paddle.fluid.data_feeder import (check_type, convert_dtype)
from paddle.fluid.framework import _non_static_mode
from paddle.fluid.layers import (ops, tensor)
from paddle.tensor import multinomial
class Categorical(distribution.Distribution):
......
......@@ -19,20 +19,14 @@
# 'sampling_id',
# 'Uniform']
import math
import warnings
import numpy as np
import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.fluid import core
from paddle.fluid.data_feeder import (check_dtype, check_type,
check_variable_and_dtype, convert_dtype)
from paddle.fluid.data_feeder import (check_variable_and_dtype, convert_dtype)
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,
elementwise_mul, elementwise_sub, nn, ops,
tensor)
from paddle.tensor import arange, concat, gather_nd, multinomial
from paddle.fluid.layers import tensor
class Distribution(object):
......
......@@ -14,7 +14,7 @@
import paddle
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):
......
......@@ -24,7 +24,7 @@ from paddle.distribution.normal import Normal
from paddle.distribution.lognormal import LogNormal
from paddle.distribution.uniform import Uniform
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"]
......
......@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import collections
import paddle
from paddle.distribution import categorical, distribution
try:
......
......@@ -13,19 +13,13 @@
# limitations under the License.
import math
import warnings
import numpy as np
import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.distribution import distribution
from paddle.fluid import core
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
from paddle.fluid.layers import (control_flow, elementwise_add, elementwise_div,
elementwise_mul, elementwise_sub, nn, ops,
tensor)
from paddle.fluid.data_feeder import (check_type, convert_dtype)
from paddle.fluid.framework import _non_static_mode
from paddle.fluid.layers import (elementwise_add, elementwise_div,
elementwise_sub, nn, ops, tensor)
try:
from collections.abc import Iterable
except:
......
......@@ -15,7 +15,6 @@
import enum
import functools
import math
import numbers
import operator
import typing
......
......@@ -12,20 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import math
import warnings
import numpy as np
from paddle import _C_ops, _legacy_C_ops
from paddle.distribution import distribution
from paddle.fluid import core
from paddle.fluid.data_feeder import (check_dtype, check_type,
check_variable_and_dtype, convert_dtype)
from paddle.fluid.data_feeder import (check_type, convert_dtype)
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,
elementwise_mul, elementwise_sub, nn, ops,
tensor)
from paddle.tensor import arange, concat, gather_nd, multinomial
from paddle.fluid.layers import (elementwise_add, elementwise_div,
elementwise_sub, nn, tensor)
class Uniform(distribution.Distribution):
......
......@@ -18,12 +18,10 @@ from ...tensor.math import tanh_ # noqa: F401
from ...fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only
from ...tensor.manipulation import chunk
from ...tensor.math import multiply
import warnings
from ...fluid.layer_helper import LayerHelper
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
import paddle
from paddle import _C_ops, _legacy_C_ops, in_dynamic_mode
......
......@@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import warnings
import paddle
from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.layers.tensor import fill_constant
from ...tensor import concat
from ...tensor.creation import zeros
from paddle.static import Variable
from ...fluid import dygraph_utils
# TODO: define the common functions to build a neural network
from ...tensor.manipulation import squeeze
from ...tensor.manipulation import unsqueeze
......@@ -27,9 +25,7 @@ from ...tensor import clip
from ...tensor import sum
from ...tensor import sqrt
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 import dygraph_utils
from ...fluid.framework import _in_legacy_dygraph, _non_static_mode, in_dygraph_mode
from paddle import _C_ops, _legacy_C_ops
from paddle.framework import in_dynamic_mode
......
......@@ -12,16 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
from ...device import get_cudnn_version
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.data_feeder import check_variable_and_dtype, check_dtype
from ...framework import ParamAttr
from ...fluid.layer_helper import LayerHelper
from ...tensor.manipulation import unsqueeze, squeeze
from ...tensor.math import add
from ...fluid.layers import nn
from paddle import _C_ops, _legacy_C_ops
from paddle import get_flags
......@@ -34,7 +30,6 @@ from paddle.device import is_compiled_with_rocm
from paddle.fluid.framework import _global_flags
from paddle.fluid.framework import _in_legacy_dygraph
from paddle.fluid.framework import in_dygraph_mode
from paddle.fluid.framework import _non_static_mode
__all__ = []
......
......@@ -19,7 +19,6 @@ from ...fluid.data_feeder import check_dtype
from ...fluid.layer_helper import LayerHelper
from ...static import Variable
from ...tensor.creation import assign
from ...fluid import dygraph_utils
from ...tensor.layer_function_generator import templatedoc
from paddle import in_dynamic_mode
from paddle import _C_ops, _legacy_C_ops
......
......@@ -12,12 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import warnings
from ...static import Variable
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 in_dynamic_mode
from ...fluid.framework import _in_legacy_dygraph, in_dygraph_mode
__all__ = []
......
......@@ -17,7 +17,6 @@ import paddle
from ...fluid.data_feeder import check_variable_and_dtype
# TODO: define loss functions of neural network
import numpy as np
import paddle
import paddle.fluid as fluid
from ...fluid.layers.nn import _elementwise_op_in_dygraph
......
......@@ -17,14 +17,11 @@ import paddle
import paddle.fluid as fluid
from ...fluid.data_feeder import check_variable_and_dtype, check_type
from ...fluid.layer_helper import LayerHelper
from ...framework import create_parameter
from ..initializer import Constant
from ...framework import ParamAttr
from ...fluid import dygraph_utils
import numbers
from paddle import _C_ops, _legacy_C_ops
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__ = []
......
......@@ -18,7 +18,6 @@ from ...tensor.manipulation import unsqueeze, squeeze
from ...fluid.data_feeder import check_type, check_variable_and_dtype
from paddle import _C_ops, _legacy_C_ops
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_dygraph_mode, _non_static_mode
......
......@@ -12,11 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import warnings
import paddle
from ...fluid.framework import default_main_program
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
......
......@@ -16,8 +16,6 @@ from ...device import get_cudnn_version
from ...static import Variable
from ...fluid.layer_helper import LayerHelper
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 ...device import is_compiled_with_rocm
from paddle import in_dynamic_mode
......
......@@ -19,7 +19,7 @@ from ...fluid import framework
from ...fluid.framework import _current_expected_place
from paddle import in_dynamic_mode
from paddle.utils import unique_name
from paddle import _C_ops, _legacy_C_ops
from paddle import _C_ops
from ... import fluid
__all__ = []
......
......@@ -15,10 +15,9 @@
from ...fluid.initializer import Initializer
from ...fluid.data_feeder import check_variable_and_dtype
from ...fluid import framework
from ...tensor import diag, transpose, sign, qr, reshape
from paddle.utils import unique_name
from ...fluid.dygraph import no_grad
from paddle import _C_ops, _legacy_C_ops
from paddle import _C_ops
__all__ = []
......
......@@ -14,7 +14,6 @@
# TODO: define activation functions of neural network
from ...framework import ParamAttr
from ..initializer import Constant
from paddle.framework import get_default_dtype
from .. import functional as F
......
......@@ -16,7 +16,6 @@
import paddle
from ...fluid.dygraph import Flatten # noqa: F401
from .. import functional as F
from ...fluid.framework import _dygraph_tracer
from paddle.nn import Layer
from paddle import in_dynamic_mode
......
......@@ -14,11 +14,10 @@
# limitations under the License.
# TODO: define loss functions of neural network
import numpy as np
import paddle.fluid as fluid
import paddle
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 paddle import in_dynamic_mode
......
......@@ -27,16 +27,14 @@
# TODO: define normalization api
import six
from ...fluid.dygraph import BatchNorm # 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 ...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 ..functional import batch_norm, layer_norm, instance_norm
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from ...fluid.layer_helper import LayerHelper
from .. import functional as F
from .. import Layer
......
......@@ -12,26 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
import collections
import itertools
import six
import math
import sys
import warnings
from functools import partial, reduce
from functools import reduce
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle import framework
from paddle.device import get_device, get_cudnn_version
from paddle.nn import functional as F
from paddle.nn import initializer as I
from paddle.nn import Layer, LayerList
from paddle.fluid.layers import utils
from paddle.fluid.layers.utils import map_structure, flatten, pack_sequence_as
from paddle.fluid.data_feeder import convert_dtype
from paddle.fluid.layers.utils import flatten, map_structure
from paddle import _C_ops, _legacy_C_ops
from paddle import in_dynamic_mode
from paddle.fluid.framework import in_dygraph_mode
......
......@@ -13,21 +13,12 @@
# limitations under the License.
import paddle
from paddle.framework import core
from paddle.fluid import dygraph_utils
from paddle.utils import unique_name
from paddle.framework import ParamAttr
from paddle.fluid.framework import _varbase_creator
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.autograd import PyLayer
import math
import copy
def round(x):
......
......@@ -14,7 +14,6 @@
import paddle
from paddle.framework import core
from paddle.fluid import dygraph_utils
from paddle.utils import unique_name
from paddle.framework import ParamAttr
from paddle.fluid.framework import _varbase_creator
......@@ -23,7 +22,7 @@ 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 _C_ops, _legacy_C_ops
from paddle import _legacy_C_ops
from paddle import in_dynamic_mode
from paddle.nn import Layer
from paddle.nn.quant.lsq import FakeQuantActLSQPlus, FakeQuantWeightLSQPlus
......
......@@ -12,9 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import math
import numpy as np
import paddle
from ..layer.conv import Conv1DTranspose, Conv2DTranspose, Conv3DTranspose
from ..layer.common import Linear
......
......@@ -16,7 +16,7 @@ from functools import reduce
import paddle
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
......
......@@ -12,14 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import numpy as np
from ... import fluid
from ...fluid import dygraph
from ...fluid import layers as F
from ...fluid.layer_helper import LayerHelper
from ...fluid.data_feeder import check_variable_and_dtype
from ...framework import in_dygraph_mode
from paddle import _C_ops, _legacy_C_ops
from paddle import _C_ops
__all__ = []
......
......@@ -13,7 +13,6 @@
# limitations under the License.
from threading import Thread
import subprocess
import multiprocessing
import six
import sys
......@@ -26,9 +25,7 @@ from six.moves import map
from six.moves import zip
import itertools
import random
import zlib
import paddle.compat as cpt
from paddle.fluid.reader import QUEUE_GET_TIMEOUT
__all__ = []
......
......@@ -14,7 +14,6 @@
# Define functions about array.
import paddle
from ..static import Variable
from ..framework import LayerHelper, core, _non_static_mode
from ..fluid.data_feeder import check_type
......
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from ..framework import core, _non_static_mode
from ..framework import core
from ..framework import LayerHelper
from ..fluid.data_feeder import check_variable_and_dtype
from ..fluid.data_feeder import check_type
......
......@@ -19,12 +19,11 @@ from paddle.common_ops_import import fill_constant
from ..fluid.layers import utils
from ..static import Variable, device_guard
from ..framework import _current_expected_place, _get_paddle_place
from ..framework import dygraph_only
from ..framework import core
from ..framework import in_dygraph_mode, _non_static_mode
from ..framework import LayerHelper
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
import paddle
from paddle import _C_ops, _legacy_C_ops
......
......@@ -16,15 +16,15 @@ import itertools
import numpy as np
import re
from .linalg import dot, matmul, transpose
from .linalg import matmul, transpose
from .manipulation import squeeze, unsqueeze, reshape
from .math import multiply
from .math import sum as paddle_sum
from ..fluid.framework import _in_legacy_dygraph
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.framework import _non_static_mode, in_dygraph_mode, _in_legacy_dygraph
from ..fluid.framework import _in_legacy_dygraph, in_dygraph_mode
import collections
import string
import opt_einsum
......
......@@ -13,17 +13,15 @@
# limitations under the License.
import re
import functools
import warnings
import string
from six.moves import cStringIO
from ..static import Variable
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 ..fluid.data_feeder import check_variable_and_dtype
import paddle
from paddle import _C_ops, _legacy_C_ops
__all__ = []
......
......@@ -14,7 +14,7 @@
import numpy as np
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 ..static import Variable
from ..fluid.framework import _in_legacy_dygraph
......@@ -24,7 +24,6 @@ from .logic import logical_not
from .creation import full
import paddle
import warnings
from paddle.common_ops_import import VarDesc
from paddle import _C_ops, _legacy_C_ops
......
......@@ -23,7 +23,7 @@ if _in_eager_mode_:
else:
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 ..fluid.framework import _in_legacy_dygraph
# TODO: define logic functions of a tensor
......
......@@ -14,16 +14,15 @@
from collections import Counter
from ..static import Variable, device_guard
from ..static import Variable
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 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.layers import utils
import numpy as np
# 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
import paddle
from paddle import _C_ops, _legacy_C_ops
......
......@@ -23,7 +23,7 @@ from paddle.common_ops_import import dygraph_utils
from .manipulation import cast
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
from ..static import Variable
......
......@@ -12,14 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
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 .. import _C_ops, _legacy_C_ops
from .. import _C_ops
__deprecated_func_name__ = {
'tanh_shrink': 'tanhshrink',
......
......@@ -14,14 +14,12 @@
import numpy as np
import paddle
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 ..fluid.data_feeder import check_dtype, check_variable_and_dtype
from ..framework import core, in_dygraph_mode, _non_static_mode
from ..fluid.framework import _in_legacy_dygraph
from paddle.common_ops_import import Variable
from paddle.common_ops_import import VarDesc
from paddle import _C_ops, _legacy_C_ops
from .logic import logical_not
# TODO: define searching & indexing functions of a tensor
# from ..fluid.layers import has_inf #DEFINE_ALIAS
......
......@@ -14,13 +14,12 @@
# TODO: define statistical functions of a tensor
import numpy as np
from ..static import Variable
from ..framework import LayerHelper
from ..framework import core
from paddle.fluid.framework import _in_legacy_dygraph, in_dygraph_mode
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
import paddle
from paddle import _C_ops, _legacy_C_ops
......
......@@ -12,10 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import numpy as np
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__ = []
......
......@@ -15,7 +15,6 @@
import unittest
import numpy as np
import contextlib
import paddle
import paddle.fluid as fluid
......
......@@ -15,7 +15,6 @@
import unittest
import numpy as np
import contextlib
import paddle
import paddle.fluid as fluid
......
......@@ -22,7 +22,6 @@ from paddle.vision.datasets import MNIST
from paddle.vision.models import LeNet
import paddle.static.amp as amp
import random
from paddle import callbacks
import argparse
import ast
......
......@@ -14,7 +14,6 @@
dependencies = ['paddle']
import paddle
from test_hapi_hub_model import MM as _MM
......
......@@ -15,7 +15,6 @@ import unittest
import librosa
import numpy as np
import os
import paddle
import paddle.audio
......
......@@ -15,12 +15,10 @@ import unittest
import librosa
import numpy as np
import os
import paddle
import paddle.audio
import scipy
from scipy import signal
import itertools
from parameterized import parameterized
......
......@@ -15,11 +15,9 @@ import unittest
import librosa
import numpy as np
import os
import paddle
import paddle.audio
from scipy import signal
import itertools
from parameterized import parameterized
......
......@@ -13,8 +13,6 @@
# limitations under the License.
import unittest
import time
import random
import tempfile
import shutil
import numpy as np
......@@ -23,7 +21,6 @@ import paddle
from paddle import Model
from paddle.static import InputSpec
from paddle.vision.models import LeNet
from paddle.hapi.callbacks import config_callbacks
from paddle.vision.datasets import MNIST
from paddle.metric import Accuracy
from paddle.nn.layer.loss import CrossEntropyLoss
......
......@@ -12,24 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
import time
import random
import tempfile
import shutil
import numpy as np
import paddle
import paddle.vision.transforms as T
from paddle import Model
from paddle.static import InputSpec
from paddle.vision.models import LeNet
from paddle.hapi.callbacks import config_callbacks
from paddle.vision.datasets import MNIST
from paddle.metric import Accuracy
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
......
......@@ -14,22 +14,14 @@
import sys
import unittest
import time
import random
import tempfile
import shutil
import numpy as np
import paddle
from paddle import Model
from paddle.static import InputSpec
from paddle.vision.models import LeNet
from paddle.hapi.callbacks import config_callbacks
import paddle.vision.transforms as T
from paddle.vision.datasets import MNIST
from paddle.metric import Accuracy
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
class MnistDataset(MNIST):
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
import time
import random
......@@ -20,15 +19,11 @@ import tempfile
import shutil
import numpy as np
import paddle
from paddle import Model
from paddle.static import InputSpec
from paddle.vision.models import LeNet
from paddle.hapi.callbacks import config_callbacks
import paddle.vision.transforms as T
from paddle.vision.datasets import MNIST
from paddle.metric import Accuracy
from paddle.nn.layer.loss import CrossEntropyLoss
class MnistDataset(MNIST):
......
......@@ -13,11 +13,7 @@
# limitations under the License.
import unittest
import os
import numpy as np
import tempfile
import shutil
import cv2
from paddle.text.datasets import UCIHousing, WMT14
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import unittest
import os
import numpy as np
from paddle.vision.datasets import voc2012, VOC2012
......
......@@ -22,7 +22,7 @@ import cv2
import paddle.vision.transforms as T
from paddle.vision.datasets import DatasetFolder, ImageFolder, MNIST, FashionMNIST, Flowers
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):
......
......@@ -18,7 +18,7 @@ import numpy as np
import paddle
import paddle.fluid as fluid
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):
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
......
......@@ -14,7 +14,6 @@
import unittest
import os
import numpy as np
import shutil
import tempfile
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import unittest
import numpy as np
......
......@@ -22,7 +22,7 @@ import tempfile
import paddle
from paddle import fluid
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.static import InputSpec
......@@ -34,7 +34,6 @@ import paddle.vision.models as models
import paddle.fluid.dygraph.jit as jit
from paddle.io import DistributedBatchSampler, Dataset
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
......
......@@ -14,7 +14,6 @@
import os
import cv2
import shutil
import unittest
import tempfile
import numpy as np
......
......@@ -21,7 +21,7 @@ import numpy as np
from PIL import Image
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.transforms import transforms
import paddle.vision.transforms.functional as F
......
......@@ -22,11 +22,11 @@ from setuptools.command.easy_install import easy_install
from setuptools.command.build_ext import build_ext
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 _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 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 IS_WINDOWS, OS_NAME, MSVC_COMPILE_FLAGS, MSVC_COMPILE_FLAGS
......
......@@ -397,7 +397,6 @@ def _get_core_name():
"""
Return pybind DSO module name.
"""
import paddle
ext_name = '.pyd' if IS_WINDOWS else '.so'
return 'libpaddle' + ext_name
......
......@@ -15,7 +15,7 @@
import paddle
from ..fluid.core import LoDTensor
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__ = [
'to_dlpack',
......
......@@ -22,7 +22,6 @@ import hashlib
import tarfile
import zipfile
import time
from collections import OrderedDict
try:
from tqdm import tqdm
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import logging
import numpy as np
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册