From 42d856caf6015cd5dcc07f0d6e019d8b9911cf6b Mon Sep 17 00:00:00 2001 From: shijianning Date: Mon, 1 Jun 2020 10:26:01 +0800 Subject: [PATCH] fix pylint warnings --- example/lstm_aclImdb/imdb.py | 2 +- example/resnet50_imagenet2012_THOR/model/thor_layer.py | 3 ++- example/resnet50_imagenet2012_THOR/train.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/example/lstm_aclImdb/imdb.py b/example/lstm_aclImdb/imdb.py index 66d04f1281..9888b4c36f 100644 --- a/example/lstm_aclImdb/imdb.py +++ b/example/lstm_aclImdb/imdb.py @@ -18,8 +18,8 @@ imdb dataset parser. import os from itertools import chain -import gensim import numpy as np +import gensim class ImdbParser(): diff --git a/example/resnet50_imagenet2012_THOR/model/thor_layer.py b/example/resnet50_imagenet2012_THOR/model/thor_layer.py index fea74605b6..32b3742f51 100644 --- a/example/resnet50_imagenet2012_THOR/model/thor_layer.py +++ b/example/resnet50_imagenet2012_THOR/model/thor_layer.py @@ -13,6 +13,8 @@ # limitations under the License. # ============================================================================ """thor_layer""" +import numpy as np + import mindspore as ms import mindspore.common.dtype as mstype from mindspore._checkparam import check_bool, twice, check_int_positive @@ -23,7 +25,6 @@ from mindspore.common.tensor import Tensor from mindspore.nn.cell import Cell from mindspore.nn.layer.activation import get_activation from mindspore.ops import operations as P -import numpy as np C0 = 16 def caculate_device_shape(matrix_dim, channel, is_A): diff --git a/example/resnet50_imagenet2012_THOR/train.py b/example/resnet50_imagenet2012_THOR/train.py index 881f3cf598..309018da57 100644 --- a/example/resnet50_imagenet2012_THOR/train.py +++ b/example/resnet50_imagenet2012_THOR/train.py @@ -17,6 +17,8 @@ import argparse import os import random +import numpy as np + from mindspore import Tensor from mindspore import context from mindspore.communication.management import init @@ -28,7 +30,6 @@ from model.model_thor import Model from model.resnet import resnet50 from model.thor import THOR -import numpy as np from config import config from crossentropy import CrossEntropy from dataset_imagenet import create_dataset