From 18f0af05298083cd94e5a7a6a0ffeb9b78cfe209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cliuxiao=E2=80=9D?= Date: Mon, 25 May 2020 19:49:06 +0800 Subject: [PATCH] pylint clean --- .../apps/bert_attention_submodules.py | 4 ++-- tests/st/networks/test_gpu_lstm.py | 2 +- tests/ut/python/ir/test_tensor.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/mindspore_test_framework/apps/bert_attention_submodules.py b/tests/mindspore_test_framework/apps/bert_attention_submodules.py index 7e49ce43d1..4ce72ffc84 100644 --- a/tests/mindspore_test_framework/apps/bert_attention_submodules.py +++ b/tests/mindspore_test_framework/apps/bert_attention_submodules.py @@ -167,7 +167,7 @@ class BertAttentionMask(nn.Cell): super(BertAttentionMask, self).__init__() self.has_attention_mask = has_attention_mask - self.multiply_data = Tensor([-1000.0, ], dtype=dtype) + self.multiply_data = Tensor([-1000.0,], dtype=dtype) self.multiply = P.Mul() if self.has_attention_mask: @@ -198,7 +198,7 @@ class BertAttentionMaskBackward(nn.Cell): dtype=mstype.float32): super(BertAttentionMaskBackward, self).__init__() self.has_attention_mask = has_attention_mask - self.multiply_data = Tensor([-1000.0, ], dtype=dtype) + self.multiply_data = Tensor([-1000.0,], dtype=dtype) self.multiply = P.Mul() self.attention_mask = Tensor(np.ones(shape=attention_mask_shape).astype(np.float32)) if self.has_attention_mask: diff --git a/tests/st/networks/test_gpu_lstm.py b/tests/st/networks/test_gpu_lstm.py index c85bcede80..bc59b7e387 100644 --- a/tests/st/networks/test_gpu_lstm.py +++ b/tests/st/networks/test_gpu_lstm.py @@ -136,7 +136,7 @@ def test_LSTM(): train_network.set_train() train_features = Tensor(np.ones([64, max_len]).astype(np.int32)) - train_labels = Tensor(np.ones([64, ]).astype(np.int32)[0:64]) + train_labels = Tensor(np.ones([64,]).astype(np.int32)[0:64]) losses = [] for epoch in range(num_epochs): loss = train_network(train_features, train_labels) diff --git a/tests/ut/python/ir/test_tensor.py b/tests/ut/python/ir/test_tensor.py index e3e3347827..9cc7208d3f 100644 --- a/tests/ut/python/ir/test_tensor.py +++ b/tests/ut/python/ir/test_tensor.py @@ -34,7 +34,7 @@ ndarr = np.ones((2, 3)) def test_tensor_flatten(): with pytest.raises(AttributeError): - lst = [1, 2, 3, 4, ] + lst = [1, 2, 3, 4,] tensor_list = ms.Tensor(lst, ms.float32) tensor_list = tensor_list.Flatten() print(tensor_list)