From 21ab029227136e0839ce1f257ebde24a03ad0d51 Mon Sep 17 00:00:00 2001 From: seatea Date: Wed, 27 May 2020 18:45:03 +0800 Subject: [PATCH] Fix pylint warning for files under `pynative_mode` directory. --- tests/ut/python/pynative_mode/test_backend.py | 2 +- tests/ut/python/pynative_mode/test_bprop.py | 2 +- tests/ut/python/pynative_mode/test_cell_bprop.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/ut/python/pynative_mode/test_backend.py b/tests/ut/python/pynative_mode/test_backend.py index be9343ed93..0b3e003d78 100644 --- a/tests/ut/python/pynative_mode/test_backend.py +++ b/tests/ut/python/pynative_mode/test_backend.py @@ -24,7 +24,7 @@ from mindspore.common.parameter import Parameter from mindspore.ops import operations as P -def setup_module(module): +def setup_module(): context.set_context(mode=context.PYNATIVE_MODE) diff --git a/tests/ut/python/pynative_mode/test_bprop.py b/tests/ut/python/pynative_mode/test_bprop.py index bbf6a270c0..6246a019c0 100644 --- a/tests/ut/python/pynative_mode/test_bprop.py +++ b/tests/ut/python/pynative_mode/test_bprop.py @@ -24,7 +24,7 @@ from mindspore.ops import operations as P from ....mindspore_test_framework.utils.bprop_util import bprop -def setup_module(module): +def setup_module(): context.set_context(mode=context.PYNATIVE_MODE) diff --git a/tests/ut/python/pynative_mode/test_cell_bprop.py b/tests/ut/python/pynative_mode/test_cell_bprop.py index b2c56ffbd4..09a096a090 100644 --- a/tests/ut/python/pynative_mode/test_cell_bprop.py +++ b/tests/ut/python/pynative_mode/test_cell_bprop.py @@ -219,7 +219,7 @@ class OneInputBprop(nn.Cell): return self.op(x) def bprop(self, x, out, dout): - return 5 * x, + return (5 * x,) def test_grad_one_input_bprop(): @@ -349,7 +349,7 @@ class MulAddWithWrongOutputNum(nn.Cell): return 2 * x + y def bprop(self, x, y, out, dout): - return 2 * dout, + return (2 * dout,) def test_grad_mul_add_with_wrong_output_num(): @@ -380,7 +380,7 @@ def test_grad_mul_add_with_wrong_output_type(): class MulAddWithWrongOutputShape(nn.Cell): def __init__(self): super(MulAddWithWrongOutputShape, self).__init__() - self.ones = Tensor(np.ones([2, ])) + self.ones = Tensor(np.ones([2,])) def construct(self, x, y): return 2 * x + y