Skip to content

Commit 66a56fe

Browse files
authored
[CodeStyle] black -> ruff format migration - part 8 (#74661)
1 parent 10e6472 commit 66a56fe

20 files changed

+0
-41
lines changed

test/legacy_test/test_gammaincc_op.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,11 @@ def init_dtype_type(self):
131131

132132

133133
class TestGammainccOp_ZeroSize(TestGammainccOp):
134-
135134
def init_shape(self):
136135
self.shape = (0, 40)
137136

138137

139138
class TestGammainccOp_ZeroSize2(TestGammainccOp):
140-
141139
def init_shape(self):
142140
self.shape = (0, 0)
143141

test/legacy_test/test_gather_nd_op.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,6 @@ def test_check_grad(self):
562562

563563
# Test Python API
564564
class TestGatherNdOpAPI(unittest.TestCase):
565-
566565
def test_case1(self):
567566
with static_guard():
568567
x1 = paddle.static.data(
@@ -596,7 +595,6 @@ def test_case3(self):
596595

597596
# Test Raise Index Error
598597
class TestGatherNdOpRaise(unittest.TestCase):
599-
600598
def test_check_raise(self):
601599
def check_raise_is_test():
602600
with static_guard():
@@ -617,7 +615,6 @@ def check_raise_is_test():
617615

618616

619617
class TestGatherNdError(unittest.TestCase):
620-
621618
def test_error1(self):
622619
with (
623620
static_guard(),
@@ -661,7 +658,6 @@ def test_index_dtype():
661658

662659

663660
class TestGatherNdAPI2(unittest.TestCase):
664-
665661
def test_static(self):
666662
with base.program_guard(base.Program(), base.Program()):
667663
data1 = paddle.static.data('data1', shape=[-1, 2], dtype='float64')

test/legacy_test/test_gather_op.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,6 @@ def test_check_grad(self):
705705

706706

707707
class API_TestGather(unittest.TestCase):
708-
709708
def test_out1(self):
710709
with base.program_guard(base.Program(), base.Program()):
711710
data1 = paddle.static.data('data1', shape=[-1, 2], dtype='float64')
@@ -813,7 +812,6 @@ def test_static_graph():
813812

814813

815814
class TestGathertError(unittest.TestCase):
816-
817815
def test_error1(self):
818816
with paddle.static.program_guard(
819817
paddle.static.Program(), paddle.static.Program()
@@ -887,7 +885,6 @@ def test_axis_maxsize():
887885

888886

889887
class TestCheckOutType(unittest.TestCase):
890-
891888
def test_out_type(self):
892889
data = paddle.static.data(shape=[16, 10], dtype='int64', name='x')
893890
index = paddle.static.data(shape=[4], dtype='int64', name='index')

test/legacy_test/test_gather_tree_op.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def backtrace(ids, parents):
5555

5656

5757
class TestGatherTreeOpAPI(unittest.TestCase):
58-
5958
def test_case(self):
6059
paddle.enable_static()
6160
ids = paddle.static.data(name='ids', shape=[5, 2, 2], dtype='int64')
@@ -78,7 +77,6 @@ def test_case2(self):
7877

7978

8079
class TestGatherTreeOpError(unittest.TestCase):
81-
8280
def test_errors(self):
8381
paddle.enable_static()
8482
with program_guard(Program(), Program()):

test/legacy_test/test_gelu_op.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,11 @@ def test_cases(self):
202202

203203

204204
class TestGeluError(unittest.TestCase):
205-
206205
def setUp(self):
207206
x = np.random.uniform(-1, 1, size=(11, 17)).astype(np.float32)
208207
self.x = paddle.to_tensor(x)
209208

210209
def test_gelu_op_error(self):
211-
212210
def test_type_error1():
213211
y = F.gelu(self.x, "tan")
214212

@@ -219,7 +217,6 @@ def test_type_error2():
219217
self.assertRaises(TypeError, test_type_error2)
220218

221219
def test_gelu_class_error(self):
222-
223220
def test_type_error1():
224221
func = nn.GELU("tan")
225222
y = func(self.x)

test/legacy_test/test_graph_send_recv_op.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ def compute_graph_send_recv_for_min_max(inputs, attributes):
378378

379379

380380
class API_GraphSendRecvOpTest(unittest.TestCase):
381-
382381
def test_static(self):
383382
paddle.enable_static()
384383
with paddle.static.program_guard(paddle.static.Program()):
@@ -541,7 +540,6 @@ def test_out_size_tensor_static(self):
541540

542541

543542
class API_GeometricSendURecvTest(unittest.TestCase):
544-
545543
def test_static(self):
546544
paddle.enable_static()
547545
with paddle.static.program_guard(paddle.static.Program()):

test/legacy_test/test_grid_sample_function.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ def load_tests(loader, standard_tests, pattern):
140140

141141

142142
class TestGridSampleAPI(unittest.TestCase):
143-
144143
def test_errors(self):
145144
with self.assertRaises(ValueError):
146145
x = paddle.randn([1, 1, 3, 3])

test/legacy_test/test_i1_op.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def setUp(self):
4646
self.place = get_places()
4747

4848
def test_api_static(self):
49-
5049
def run(place):
5150
paddle.enable_static()
5251
with paddle.static.program_guard(paddle.static.Program()):

test/legacy_test/test_i1e_op.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def setUp(self):
4646
self.place = get_places()
4747

4848
def test_api_static(self):
49-
5049
def run(place):
5150
paddle.enable_static()
5251
with paddle.static.program_guard(paddle.static.Program()):

test/legacy_test/test_increment.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222

2323
class TestIncrement(unittest.TestCase):
24-
2524
def test_api(self):
2625
paddle.enable_static()
2726
with base.program_guard(base.Program(), base.Program()):
@@ -62,7 +61,6 @@ def test_no_inplace_increment(self):
6261

6362

6463
class TestInplaceApiWithDataTransform(unittest.TestCase):
65-
6664
def test_increment(self):
6765
if base.core.is_compiled_with_cuda():
6866
paddle.enable_static()
@@ -77,7 +75,6 @@ def test_increment(self):
7775

7876

7977
class TestIncrement_ZeroSize(unittest.TestCase):
80-
8178
def test_api(self):
8279
with base.dygraph.guard():
8380
input = paddle.randn(shape=[0]).astype('int64')

0 commit comments

Comments
 (0)