Skip to content

补充 squared_l2_norm 与常用 Paddle API 的 Torch 转换规则 - #720

Merged
feixi139 merged 2 commits into
PFCCLab:mainfrom
feixi139:fix/squared-l2-norm-convert
Aug 27, 2026
Merged

补充 squared_l2_norm 与常用 Paddle API 的 Torch 转换规则#720
feixi139 merged 2 commits into
PFCCLab:mainfrom
feixi139:fix/squared-l2-norm-convert

Conversation

@feixi139

Copy link
Copy Markdown
Collaborator

背景

补充 Paddle-to-Torch 转换覆盖,避免相关 API 因缺少 mapping 被归类为 config_convert。

修改内容

  • 为 paddle.nn.clip._squared_l2_norm 注册现有 CopsSquaredL2NormRule。
  • 增加 paddle.baddbmm、paddle.cat、paddle.clamp、paddle.nn.init.normal_ 和 paddle.randn 的 GenericRule 映射。
  • 保持变更范围在 tester/paddle_to_torch/mapping.json。

验证

  • pre-commit run --files tester/paddle_to_torch/mapping.json:通过。
  • python -m json.tool tester/paddle_to_torch/mapping.json:通过。
  • 5 个新增 API 的转换器 smoke check:均为 direct。
  • tools/regression/regression_runner.sh:Paddle-only 438/438 通过;accuracy 427 pass、6 skip、2 timeout、3 torch_error,未出现 config_convert 错误。后 5 项来自默认回归配置中的其他 API,回归 gate 已报告这些非本次映射相关问题。

@feixi139
feixi139 merged commit 6c9e28f into PFCCLab:main Aug 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant