Skip to content

Commit a1b2d05

Browse files
authored
[CodeStyle] black -> ruff format migration - part 5 (#74658)
1 parent 66a56fe commit a1b2d05

20 files changed

+0
-38
lines changed

test/ir/inference/test_trt_convert_gather_nd.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ def generate_dynamic_shape(self, attrs):
8484
def sample_predictor_configs(
8585
self, program_config, run_pir=False
8686
) -> tuple[paddle_infer.Config, list[int], float]:
87-
8887
def clear_dynamic_shape():
8988
self.dynamic_shape.max_input_shape = {}
9089
self.dynamic_shape.min_input_shape = {}
@@ -182,7 +181,6 @@ def generate_dynamic_shape(self, attrs):
182181
def sample_predictor_configs(
183182
self, program_config, run_pir=False
184183
) -> tuple[paddle_infer.Config, list[int], float]:
185-
186184
def clear_dynamic_shape():
187185
self.dynamic_shape.max_input_shape = {}
188186
self.dynamic_shape.min_input_shape = {}
@@ -280,7 +278,6 @@ def generate_dynamic_shape(self, attrs):
280278
def sample_predictor_configs(
281279
self, program_config, run_pir=False
282280
) -> tuple[paddle_infer.Config, list[int], float]:
283-
284281
def clear_dynamic_shape():
285282
self.dynamic_shape.max_input_shape = {}
286283
self.dynamic_shape.min_input_shape = {}
@@ -378,7 +375,6 @@ def generate_dynamic_shape(self, attrs):
378375
def sample_predictor_configs(
379376
self, program_config, run_pir=False
380377
) -> tuple[paddle_infer.Config, list[int], float]:
381-
382378
def clear_dynamic_shape():
383379
self.dynamic_shape.max_input_shape = {}
384380
self.dynamic_shape.min_input_shape = {}
@@ -476,7 +472,6 @@ def generate_dynamic_shape(self, attrs):
476472
def sample_predictor_configs(
477473
self, program_config, run_pir=False
478474
) -> tuple[paddle_infer.Config, list[int], float]:
479-
480475
def clear_dynamic_shape():
481476
self.dynamic_shape.max_input_shape = {}
482477
self.dynamic_shape.min_input_shape = {}

test/ir/inference/test_trt_convert_hard_sigmoid.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def generate_dynamic_shape(self):
8585
def sample_predictor_configs(
8686
self, program_config, run_pir=False
8787
) -> tuple[paddle_infer.Config, list[int], float]:
88-
8988
def clear_dynamic_shape():
9089
self.dynamic_shape.max_input_shape = {}
9190
self.dynamic_shape.min_input_shape = {}

test/ir/inference/test_trt_explicit_quantization_mobilenet.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ def conv_bn_layer(
167167
use_cudnn=True,
168168
name=None,
169169
):
170-
171170
conv = paddle.static.nn.conv2d(
172171
input=input,
173172
num_filters=num_filters,

test/ir/pir/fused_pass/test_pir_horizontal_fuse_pass.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ def is_program_valid(self, program=None):
332332
return True
333333

334334
def sample_program(self):
335-
336335
with paddle.pir_utils.IrGuard():
337336
start_prog = paddle.static.Program()
338337
main_prog = paddle.static.Program()

test/legacy_test/test_activation_nn_grad.py

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

2727

2828
class TestSigmoidTripleGradCheck(unittest.TestCase):
29-
3029
@prog_scope()
3130
def func(self, place):
3231
shape = [2, 3, 7, 9]
@@ -164,7 +163,6 @@ def test_grad(self):
164163

165164

166165
class TestReluDoubleGradCheck(unittest.TestCase):
167-
168166
@prog_scope()
169167
def func(self, place):
170168
shape = [2, 3, 7, 9]
@@ -485,7 +483,6 @@ def test_grad(self):
485483

486484

487485
class TestCosDoubleGradCheck2(unittest.TestCase):
488-
489486
def _check_cos_double_dynamic(self, place):
490487
with dygraph_guard():
491488
x = paddle.randn([64, 64])

test/legacy_test/test_activation_op.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def dynamic_guard():
4747

4848

4949
class TestSqrtOpError(unittest.TestCase):
50-
5150
def test_errors(self):
5251
with (
5352
static_guard(),
@@ -229,7 +228,6 @@ def init_dtype(self):
229228

230229

231230
class Test_Exp_Op_Fp16(unittest.TestCase):
232-
233231
def test_api_fp16(self):
234232
with (
235233
static_guard(),
@@ -1124,7 +1122,6 @@ def test_backward(self):
11241122

11251123

11261124
class TestSinhOpError(unittest.TestCase):
1127-
11281125
def test_errors(self):
11291126
with (
11301127
static_guard(),
@@ -1258,7 +1255,6 @@ def test_backward(self):
12581255

12591256

12601257
class TestCoshOpError(unittest.TestCase):
1261-
12621258
def test_errors(self):
12631259
with (
12641260
static_guard(),
@@ -4299,7 +4295,6 @@ def test_api_bf16(self):
42994295

43004296

43014297
class TestLog10API(unittest.TestCase):
4302-
43034298
def test_api(self):
43044299
with static_guard():
43054300
with paddle.static.program_guard(
@@ -4390,7 +4385,6 @@ def init_dtype(self):
43904385

43914386

43924387
class Test_Log1p_Op_Fp16(unittest.TestCase):
4393-
43944388
def test_api_fp16(self):
43954389
with (
43964390
static_guard(),
@@ -4445,7 +4439,6 @@ def init_shape(self):
44454439

44464440

44474441
class TestLog1pAPI(unittest.TestCase):
4448-
44494442
def test_api(self):
44504443
with static_guard():
44514444
with base.program_guard(

test/legacy_test/test_adamw_op.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def setUp(self):
176176
}
177177

178178
def test_check_output(self):
179-
180179
self.check_output(no_check_set=self.no_check_set, check_pir=True)
181180

182181

test/legacy_test/test_allclose_op.py

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

180180

181181
class TestAllcloseOpFp16(unittest.TestCase):
182-
183182
def test_fp16(self):
184183
if core.is_compiled_with_cuda():
185184
x_data = np.random.rand(10, 10).astype('float16')

test/legacy_test/test_alpha_dropout.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def test_dygraph_bfp16(self):
118118

119119

120120
class TestAlphaDropoutFunctionAPIError(unittest.TestCase):
121-
122121
def test_input_type_errors(self):
123122
with paddle.static.program_guard(
124123
paddle.static.Program(), paddle.static.Program()

test/legacy_test/test_arange.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def init_config(self):
130130

131131

132132
class TestArangeOpError(unittest.TestCase):
133-
134133
def test_static_errors(self):
135134
with program_guard(Program(), Program()):
136135
paddle.enable_static()
@@ -224,7 +223,6 @@ def test_unisfinite_end_errors(self):
224223

225224

226225
class TestArangeAPI(unittest.TestCase):
227-
228226
def test_out(self):
229227
paddle.enable_static()
230228
with paddle.static.program_guard(

0 commit comments

Comments
 (0)