Skip to content

Commit 912959a

Browse files
authored
support paddle.Size (#607)
1 parent 9627c49 commit 912959a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tester/api_config/config_analyzer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,6 +2809,13 @@ def __init__(self, config):
28092809
self.config = config
28102810
self.args = []
28112811
self.kwargs = collections.OrderedDict()
2812+
2813+
# 兼容 paddle.Size([...]) 格式:将其替换为 [...]
2814+
def replace_paddle_size(match):
2815+
shape_list = match.group(1) # 提取 [...] 部分
2816+
return shape_list
2817+
2818+
config = re.sub(r"paddle\.Size\(\s*(\[[^\]]*\])\s*\)", replace_paddle_size, config)
28122819
config = config.replace("Tensor(", "TensorConfig(")
28132820

28142821
self.api_name, offset = self.get_api(config)

0 commit comments

Comments
 (0)