Skip to content

Commit 2c05879

Browse files
authored
[CodeStyle] black -> ruff format migration - part 13 (#74666)
1 parent 5d0b40f commit 2c05879

20 files changed

+2
-32
lines changed

test/legacy_test/ernie_utils/moe_all_gather_layer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def __init__(
8989
group_experts=False,
9090
moe_statics=None,
9191
):
92-
9392
super().__init__(
9493
gate,
9594
experts,

test/legacy_test/ernie_utils/moe_layer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
Returns:
2020
_type_: _description_
2121
"""
22+
2223
from __future__ import annotations
2324

2425
import logging

test/legacy_test/hygon_dcu/hygon_llama_ops.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ def test_check_gradient(self):
401401

402402
# test mean op
403403
class TestFP16MeanOp(OpTest):
404-
405404
def setUp(self):
406405
self.op_type = "mean"
407406
self.python_api = paddle.mean
@@ -441,7 +440,6 @@ def test_checkout_grad(self):
441440

442441
# test scale op
443442
class TestScaleFp16Op(OpTest):
444-
445443
def setUp(self):
446444
self.op_type = "scale"
447445
self.python_api = paddle.scale
@@ -466,7 +464,6 @@ def test_check_grad(self):
466464

467465
# test sum op
468466
class TestAFP16SumOp(OpTest):
469-
470467
def setUp(self):
471468
self.op_type = "sum"
472469
self.python_api = paddle.add_n
@@ -528,7 +525,6 @@ def test_check_output(self):
528525

529526
# test add, add_grad op
530527
class TestFP16ElementwiseAddOp(OpTest):
531-
532528
def setUp(self):
533529
self.op_type = "elementwise_add"
534530
self.python_api = paddle.add
@@ -612,7 +608,6 @@ def test_check_grad_ignore_y(self):
612608

613609
# test multiply, multiply_grad op
614610
class TestElementwiseMulOpFp16(OpTest):
615-
616611
def setUp(self):
617612
self.op_type = "elementwise_mul"
618613
self.prim_op_type = "prim"
@@ -791,7 +786,6 @@ def test_check_output(self):
791786

792787
# test matmul, matmul_grad op
793788
class TestMatMulV2Op(OpTest):
794-
795789
def config(self):
796790
self.x_shape = (100,)
797791
self.y_shape = (100,)

test/legacy_test/test_uniform_random_op.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ def init_dtype(self):
206206

207207

208208
class TestUniformRandomOpError(unittest.TestCase):
209-
210209
def test_errors(self):
211210
paddle.enable_static()
212211
main_prog = Program()
@@ -305,7 +304,6 @@ def check_with_place(self, place):
305304

306305

307306
class TestUniformRandomOpApi(unittest.TestCase):
308-
309307
def test_api(self):
310308
paddle.enable_static()
311309
paddle.seed(10)
@@ -343,7 +341,6 @@ def test_api(self):
343341

344342

345343
class TestUniformRandomOp_attr_tensor_API(unittest.TestCase):
346-
347344
def test_attr_tensor_API(self):
348345
paddle.enable_static()
349346
startup_program = base.Program()
@@ -402,7 +399,6 @@ def test_attr_tensor_int32_API(self):
402399

403400

404401
class TestUniformRandomOp_API_seed(unittest.TestCase):
405-
406402
def test_attr_tensor_API(self):
407403
paddle.enable_static()
408404
_seed = 10
@@ -456,7 +452,6 @@ def check_with_place(self, place):
456452

457453

458454
class TestUniformRandomOpSelectedRowsShapeTensorList(unittest.TestCase):
459-
460455
def test_check_output(self):
461456
for place in get_places():
462457
self.check_with_place(place)
@@ -493,7 +488,6 @@ def test_check_output(self):
493488

494489

495490
class TestUniformRandomBatchSizeLikeOpError(unittest.TestCase):
496-
497491
def test_errors(self):
498492
paddle.enable_static()
499493
main_prog = Program()
@@ -527,7 +521,6 @@ def test_dtype():
527521

528522

529523
class TestUniformAlias(unittest.TestCase):
530-
531524
def test_alias(self):
532525
paddle.uniform([2, 3], min=-5.0, max=5.0)
533526
paddle.tensor.uniform([2, 3], min=-5.0, max=5.0)
@@ -540,7 +533,6 @@ def test_uniform_random():
540533

541534

542535
class TestUniformOpError(unittest.TestCase):
543-
544536
def test_errors(self):
545537
paddle.enable_static()
546538
main_prog = Program()

test/legacy_test/test_unpool1d_op.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ def test_case(self):
179179

180180

181181
class TestUnpool1DOpAPI_static(unittest.TestCase):
182-
183182
def test_case(self):
184183
paddle.enable_static()
185184
for place in get_places():

test/legacy_test/test_unpool3d_op.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ def test_case(self):
410410

411411

412412
class TestUnpool3DOpAPI_static(unittest.TestCase):
413-
414413
def test_case(self):
415414
paddle.enable_static()
416415
for place in get_places():

test/legacy_test/test_unpool_indices.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ def test_case(self):
377377

378378

379379
class TestUnpool1DAPI_st(unittest.TestCase):
380-
381380
def test_case(self):
382381
paddle.enable_static()
383382
for place in get_places():
@@ -455,7 +454,6 @@ def test_case(self):
455454

456455

457456
class TestUnpool2DAPI_st(unittest.TestCase):
458-
459457
def test_case(self):
460458
paddle.enable_static()
461459
for place in get_places():
@@ -542,7 +540,6 @@ def test_case(self):
542540

543541

544542
class TestUnpool3DAPI_st2(unittest.TestCase):
545-
546543
def test_case(self):
547544
paddle.enable_static()
548545
for place in get_places():

test/legacy_test/test_unpool_op.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ def test_case(self):
456456

457457

458458
class TestUnpoolOpAPI_st(unittest.TestCase):
459-
460459
def test_case(self):
461460
import paddle
462461
import paddle.nn.functional as F

test/legacy_test/test_unstack_op.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ def test_check_grad(self):
236236

237237

238238
class TestUnstackZeroInputOp(unittest.TestCase):
239-
240239
def unstack_zero_input_static(self):
241240
paddle.enable_static()
242241

test/legacy_test/test_variance_layer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def test_alias(self):
116116

117117

118118
class TestVarError(unittest.TestCase):
119-
120119
def test_error(self):
121120
with paddle.static.program_guard(paddle.static.Program()):
122121
x = paddle.static.data('X', [2, 3, 4], 'int32')

0 commit comments

Comments
 (0)