Skip to content

Commit 62b382d

Browse files
committed
fix trt convert conv2d skip
1 parent 2c47678 commit 62b382d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ def is_program_valid(self, program_config: ProgramConfig) -> bool:
3434
1] * attrs[0]['groups']:
3535
return False
3636

37+
ver = paddle_infer.get_trt_compile_version()
38+
if ver[0] * 1000 + ver[1] * 100 + ver[0] * 10 < 7000:
39+
if attrs[0]['padding_algorithm'] == 'SAME' and (
40+
attrs[0]['strides'][0] > 1 or attrs[0]['strides'][1] > 1):
41+
return False
42+
3743
return True
3844

3945
def sample_program_configs(self):

python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_conv2d_fusion.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ def is_program_valid(self, program_config: ProgramConfig) -> bool:
3737
if attrs[0]['groups'] <= 1:
3838
return False
3939

40+
ver = paddle_infer.get_trt_compile_version()
41+
if ver[0] * 1000 + ver[1] * 100 + ver[0] * 10 < 7000:
42+
if attrs[0]['padding_algorithm'] == 'SAME' and (
43+
attrs[0]['strides'][0] > 1 or attrs[0]['strides'][1] > 1):
44+
return False
45+
4046
return True
4147

4248
def sample_program_configs(self):

0 commit comments

Comments
 (0)