From 412f4389ee167dc54e9f3300037b899726f5f919 Mon Sep 17 00:00:00 2001 From: zhangzefeng Date: Thu, 20 Apr 2023 12:46:37 +0800 Subject: [PATCH] fix pad infer shape --- python/conformance/diopi_functions.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/conformance/diopi_functions.py b/python/conformance/diopi_functions.py index 0991844..5cee69a 100644 --- a/python/conformance/diopi_functions.py +++ b/python/conformance/diopi_functions.py @@ -3193,10 +3193,7 @@ def pad(input, pad, mode='constant', value=None): "Padding length must be equal or more than length of input" paded_length = len(pad) // 2 for i in range(paded_length): - if len(pad) <= len(sizeO): - pad_idx = paded_length - i - else: - pad_idx = i + 1 + pad_idx = i + 1 sizeO[-pad_idx] += (pad[2 * i] + pad[2 * i + 1]) pad = Sizes(pad) if value is None and mode == 'constant':