diff --git a/tests/mindspore_test_framework/apps/bert_attention_submodules.py b/tests/mindspore_test_framework/apps/bert_attention_submodules.py index 7e49ce43d14cbb9a78472e2b7816a4bdf31f4a4e..4ce72ffc84f1bbb4533c5150eba79ed678783c6d 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 c85bcede8047ad8bedf086335fb83d19233d7963..bc59b7e38722743b4c8e67df65862f7c15ab3199 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 e3e3347827205f7d41bc95587d7172c4191a7781..9cc7208d3f520cef96dc22fe8b1d45c7f646cc63 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)