【启航计划】PaddlePaddle API兼容性增强
Author: zhwesky2010Created Nov 7, 2025Updated Aug 30, 2026
Labelsgood first issue
背景
为了降低新模型(特别是新的大模型)使用飞桨开发或迁移到飞桨的成本,飞桨在3.2版本开展了 API兼容性适配 工作,提升了API针对不同框架写法的自适应能力,针对Pytorch项目,仅需修改接口代码前缀torch.为paddle.,即可无缝迁移到Paddle。
当前已完成了500+个重点API与Pytorch API的无缝兼容工作(包括:API名称、参数名称、参数个数、参数语义),具体名单详见 PyTorch-Paddle API 映射表。但仍有很多Paddle API尚未完成兼容性适配 工作,本次活动旨在对Paddle API进行整体兼容性推全。
任务讲解:https://meeting.tencent.com/cw/KP4g34Y9f3 (第5分钟开始)
示例修改&提交方式&FAQ
https://github.com/PaddlePaddle/Paddle/issues/76301#issuecomment-3502554429
认领方式
请大家以 comment 的形式认领任务,如:
【报名】:1、3、2-3- 多个任务之间需要使用中文顿号分隔,报名多个连续任务可用横线表示,如 1-2
- PR 提交格式:
- PR顺序:不同仓库分别提交 PR,Paddle 的 PR 合入后,再合入 PaConvert、Docs的 PR
- PR标题:
- 不同仓库的 PR 标题均以 [API Compatibility No.xxx] 开头,注明任务编号
- Paddle/PaConvert 仓库的 PR 标题以 -part 结尾
- PR描述:PR Category 填 User Experience,PR Types 填 New features
任务表
| 序号 | Pytorch API | 认领人 / 状态 / PR号 | Paddle API | 参考方案(仅供参考,以PaConvert验收为准) |
|---|---|---|---|---|
| 1 | @wwaawwaaee @enkilee |
paddle.Tensor.addmm_ | c++下沉或装饰器 {'mat1': 'x', 'mat2': 'y'}; | |
| 2 | @youge325 |
paddle.Tensor.baddbmm_ | c++下沉或装饰器 {'batch1': 'x', 'batch2': 'y'}; | |
| 3 | @youge325 @ADchampion3 |
paddle.Tensor.bitwise_and_ | c++下沉或装饰器 {'other': 'y'}; | |
| 4 | @ADchampion3 |
paddle.Tensor.bitwise_left_shift_ | c++下沉或装饰器 {'other': 'y'}; | |
| 5 | @ADchampion3 |
paddle.Tensor.bitwise_right_shift_ | c++下沉或装饰器 {'other': 'y'}; | |
| 6 | @Manfredss |
paddle.Tensor.bitwise_xor_ | c++下沉或装饰器 {'other': 'y'}; | |
| 7 | @WHoutstanding |
paddle.Tensor.cauchy_ | c++下沉或装饰器 {'median': 'loc', 'sigma': 'scale'}; | |
| 8 | @WHoutstanding |
paddle.Tensor.copysign_ | c++下沉或装饰器 {'other': 'y'}; | |
| 9 | @xunyoyo |
paddle.Tensor.cumsum_ | c++下沉或装饰器 {'dim': 'axis', 'dtype': 'dtype'}; | |
| 10 | torch.Tensor.floor_divide_ | @CAICAIIs |
paddle.Tensor.floor_divide_ | c++下沉或装饰器 {'other': 'y'}; |
| 11 | @Manfredss |
paddle.Tensor.gcd_ | c++下沉或装饰器 {'other': 'y'}; | |
| 12 | @xunyoyo |
paddle.Tensor.geometric_ | c++下沉或装饰器 {'p': 'probs'}; | |
| 13 | @Khoray |
paddle.Tensor.hypot_ | c++下沉或装饰器 {'other': 'y'}; | |
| 14 | @xunyoyo |
paddle.Tensor.index_fill_ | c++下沉或装饰器 {'dim': 'axis'}; | |
| 15 | @Aidenwu0209 |
paddle.Tensor.index_put_ | c++下沉或装饰器 {'values': 'value'}; | |
| 16 | @Manfredss |
paddle.Tensor.lcm_ | c++下沉或装饰器 {'other': 'y'}; | |
| 17 | torch.Tensor.ldexp_ | @pxzbest |
paddle.Tensor.ldexp_ | c++下沉或装饰器 {'other': 'y'}; |
| 18 | @Aidenwu0209 |
paddle.Tensor.lerp_ | c++下沉或装饰器 {'end': 'y'}; | |
| 19 | torch.Tensor.pow_ | @NJX-njx |
paddle.Tensor.pow_ | c++下沉或装饰器 {'exponent': 'y'}; |
| 20 | torch.Tensor.remainder_ | @CAICAIIs |
paddle.Tensor.remainder_ | c++下沉或装饰器 {'other': 'y'}; |
| 21 | @enkilee |
paddle.Tensor.renorm_ | c++下沉或装饰器 {'dim': 'axis', 'maxnorm': 'max_norm'}; | |
| 22 | torch.Tensor.squeeze_ | @xunyoyo |
paddle.Tensor.squeeze_ | c++下沉或装饰器 {'dim': 'axis'}; |
| 23 | torch.Tensor.unsqueeze_ | @xunyoyo |
paddle.Tensor.unsqueeze_ | c++下沉或装饰器 {'dim': 'axis'}; |
| 24 | @onenewcode @algorithm1832 |
paddle.abs_ | c++下沉或装饰器 {'input': 'x'}; | |
| 25 | @enkilee |
paddle.acos | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 26 | @enkilee |
paddle.acosh | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 27 | @enkilee |
paddle.addmm | c++下沉或装饰器 {'mat1': 'x', 'mat2': 'y'}; 新增out; | |
| 28 | @enkilee |
paddle.angle | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 29 | @enkilee |
paddle.as_strided | c++下沉或装饰器 {'input': 'x', 'size': 'shape', 'storage_offset': 'offset'}; | |
| 30 | @Manfredss |
paddle.asin | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 31 | @Manfredss |
paddle.asinh | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 32 | @Manfredss |
paddle.atan | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 33 | @Manfredss |
paddle.atan2 | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | |
| 34 | @enkilee |
paddle.atanh | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 35 | @youge325 |
paddle.baddbmm | c++下沉或装饰器 {'batch1': 'x', 'batch2': 'y'}; 新增out; | |
| 36 | torch.bernoulli | @xunyoyo |
paddle.bernoulli | c++下沉或装饰器 {'input': 'x'}; 新增out; |
| 37 | @Carousel126 |
paddle.bincount | c++下沉或装饰器 {'input': 'x'}; | |
| 38 | @youge325 |
paddle.bitwise_and | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | |
| 39 | paddle.bitwise_left_shift | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | ||
| 40 | paddle.bitwise_not | c++下沉或装饰器 {'input': 'x'}; 新增out; | ||
| 41 | paddle.bitwise_right_shift | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | ||
| 42 | @Manfredss |
paddle.bitwise_xor | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | |
| 43 | paddle.block_diag | c++下沉或装饰器 {'tensors': 'inputs'}; | ||
| 44 | paddle.broadcast_tensors | c++下沉或装饰器 {'tensors': 'input'}; | ||
| 45 | @SidusAntares |
paddle.cartesian_prod | c++下沉或装饰器 {'tensors': 'x'}; | |
| 46 | paddle.cdist | c++下沉或装饰器 {'x1': 'x', 'x2': 'y'}; | ||
| 47 | torch.clone | @liulin1124 @enkilee |
paddle.clone | c++下沉或装饰器 {'input': 'x'}; |
| 48 | torch.column_stack | @enkilee |
paddle.column_stack | c++下沉或装饰器 {'tensors': 'x'}; 新增out; |
| 49 | torch.combinations | paddle.combinations | c++下沉或装饰器 {'input': 'x'}; | |
| 50 | @enkilee |
paddle.conj | c++下沉或装饰器 {'input': 'x'}; | |
| 51 | paddle.copysign | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | ||
| 52 | @algorithm1832 |
paddle.cosh | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 53 | torch.count_nonzero | @MerlinSMQWQ |
paddle.count_nonzero | c++下沉或装饰器 {'input': 'x', 'dim': 'axis'}; |
| 54 | @pxzbest |
paddle.cross | c++下沉或装饰器 {'input': 'x', 'other': 'y', 'dim': 'axis'}; 新增out; | |
| 55 | torch.cummax | @xcq-code |
paddle.cummax | c++下沉或装饰器 {'input': 'x', 'dim': 'axis'}; 新增out; |
| 56 | torch.cummin | @xcq-code |
paddle.cummin | c++下沉或装饰器 {'input': 'x', 'dim': 'axis'}; 新增out; |
| 57 | torch.cumulative_trapezoid | paddle.cumulative_trapezoid | c++下沉或装饰器 {'dim': 'axis'}; | |
| 58 | @algorithm1832 |
paddle.diag | c++下沉或装饰器 {'input': 'x', 'diagonal': 'offset'}; 新增out; | |
| 59 | torch.diagflat | @HaolinGuan7211 |
paddle.diagflat | c++下沉或装饰器 {'input': 'x'}; |
| 60 | torch.diagonal_scatter | paddle.diagonal_scatter | c++下沉或装饰器 {'input': 'x', 'src': 'y', 'dim1': 'axis1', 'dim2': 'axis2'}; | |
| 61 | paddle.dist | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; | ||
| 62 | torch.dsplit | @enkilee |
paddle.dsplit | c++下沉或装饰器 {'input': 'x', 'indices': 'num_or_indices', 'sections': 'num_or_indices'}; |
| 63 | torch.dstack | @enkilee |
paddle.dstack | c++下沉或装饰器 {'tensors': 'x'}; 新增out; |
| 64 | paddle.flip | c++下沉或装饰器 {'input': 'x', 'dims': 'axis'}; | ||
| 65 | paddle.fmax | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | ||
| 66 | paddle.fmin | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | ||
| 67 | @algorithm1832 |
paddle.frac | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 68 | torch.frexp | paddle.frexp | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 69 | torch.gcd | @Manfredss |
paddle.gcd | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; |
| 70 | paddle.heaviside | c++下沉或装饰器 {'input': 'x', 'values': 'y'}; 新增out; | ||
| 71 | torch.histogram | paddle.histogram | c++下沉或装饰器 {'range': ['min', 'max']}; 新增out; | |
| 72 | torch.histogramdd | paddle.histogramdd | c++下沉或装饰器 {'input': 'x', 'range': 'ranges', 'weight': 'weights'}; | |
| 73 | torch.hsplit | @enkilee |
paddle.hsplit | c++下沉或装饰器 {'input': 'x', 'indices': 'num_or_indices', 'sections': 'num_or_indices'}; |
| 74 | torch.hstack | @enkilee |
paddle.hstack | c++下沉或装饰器 {'tensors': 'x'}; 新增out; |
| 75 | torch.hypot | @Khoray @enkilee |
paddle.hypot | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; |
| 76 | torch.iinfo | @why1te |
paddle.iinfo | c++下沉或装饰器 {'type': 'dtype'}; |
| 77 | torch.imag | @liulin1124 |
paddle.imag | c++下沉或装饰器 {'input': 'x'}; |
| 78 | paddle.index_add | c++下沉或装饰器 {'input': 'x', 'dim': 'axis'}; 新增out; | ||
| 79 | paddle.index_fill | c++下沉或装饰器 {'input': 'x', 'dim': 'axis'}; | ||
| 80 | torch.inner | paddle.inner | c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out; | |
| 81 | torch.isneginf | paddle.isneginf | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 82 | torch.isposinf | paddle.isposinf | c++下沉或装饰器 {'input': 'x'}; 新增out; | |
| 83 | torch.isreal | @Carousel126 |
Source: PaddlePaddle/Paddle