#76301·Paddle

【启航计划】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 torch.Tensor.addmm_ @wwaawwaaee
@enkilee #77385
paddle.Tensor.addmm_ c++下沉或装饰器 {'mat1': 'x', 'mat2': 'y'};
2 torch.Tensor.baddbmm_ @youge325 #76578 #77177 #7677 #798
paddle.Tensor.baddbmm_ c++下沉或装饰器 {'batch1': 'x', 'batch2': 'y'};
3 torch.Tensor.bitwise_and_ @youge325 #76705
@ADchampion3
paddle.Tensor.bitwise_and_ c++下沉或装饰器 {'other': 'y'};
4 torch.Tensor.bitwise_left_shift_ @ADchampion3 #76795
paddle.Tensor.bitwise_left_shift_ c++下沉或装饰器 {'other': 'y'};
5 torch.Tensor.bitwise_right_shift_ @ADchampion3 #76795
paddle.Tensor.bitwise_right_shift_ c++下沉或装饰器 {'other': 'y'};
6 torch.Tensor.bitwise_xor_ @Manfredss #76341 #754
paddle.Tensor.bitwise_xor_ c++下沉或装饰器 {'other': 'y'};
7 torch.Tensor.cauchy_ @WHoutstanding
paddle.Tensor.cauchy_ c++下沉或装饰器 {'median': 'loc', 'sigma': 'scale'};
8 torch.Tensor.copysign_ @WHoutstanding
paddle.Tensor.copysign_ c++下沉或装饰器 {'other': 'y'};
9 torch.Tensor.cumsum_ @xunyoyo #77573 #7704 #820
paddle.Tensor.cumsum_ c++下沉或装饰器 {'dim': 'axis', 'dtype': 'dtype'};
10 torch.Tensor.floor_divide_ @CAICAIIs #77556 #818
paddle.Tensor.floor_divide_ c++下沉或装饰器 {'other': 'y'};
11 torch.Tensor.gcd_ @Manfredss #76486 #787 #7670
paddle.Tensor.gcd_ c++下沉或装饰器 {'other': 'y'};
12 torch.Tensor.geometric_ @xunyoyo
paddle.Tensor.geometric_ c++下沉或装饰器 {'p': 'probs'};
13 torch.Tensor.hypot_ @Khoray #78046 #833 #7851
paddle.Tensor.hypot_ c++下沉或装饰器 {'other': 'y'};
14 torch.Tensor.index_fill_ @xunyoyo #77470 #77725
paddle.Tensor.index_fill_ c++下沉或装饰器 {'dim': 'axis'};
15 torch.Tensor.index_put_ @Aidenwu0209 #77792
paddle.Tensor.index_put_ c++下沉或装饰器 {'values': 'value'};
16 torch.Tensor.lcm_ @Manfredss #76486 #787 #7670
paddle.Tensor.lcm_ c++下沉或装饰器 {'other': 'y'};
17 torch.Tensor.ldexp_ @pxzbest #77766 #835
paddle.Tensor.ldexp_ c++下沉或装饰器 {'other': 'y'};
18 torch.Tensor.lerp_ @Aidenwu0209 #77793
paddle.Tensor.lerp_ c++下沉或装饰器 {'end': 'y'};
19 torch.Tensor.pow_ @NJX-njx #78126
paddle.Tensor.pow_ c++下沉或装饰器 {'exponent': 'y'};
20 torch.Tensor.remainder_ @CAICAIIs
paddle.Tensor.remainder_ c++下沉或装饰器 {'other': 'y'};
21 torch.Tensor.renorm_ @enkilee #77708
paddle.Tensor.renorm_ c++下沉或装饰器 {'dim': 'axis', 'maxnorm': 'max_norm'};
22 torch.Tensor.squeeze_ @xunyoyo #77550 #77725
paddle.Tensor.squeeze_ c++下沉或装饰器 {'dim': 'axis'};
23 torch.Tensor.unsqueeze_ @xunyoyo #77551 #77725
paddle.Tensor.unsqueeze_ c++下沉或装饰器 {'dim': 'axis'};
24 torch.abs_ @onenewcode #76431
@algorithm1832 #76994 #77294 #811 #7697
paddle.abs_ c++下沉或装饰器 {'input': 'x'};
25 torch.acos @enkilee #76390 #7654 #775
paddle.acos c++下沉或装饰器 {'input': 'x'}; 新增out;
26 torch.acosh @enkilee #76456 #783 #7657
paddle.acosh c++下沉或装饰器 {'input': 'x'}; 新增out;
27 torch.addmm @enkilee #77385
paddle.addmm c++下沉或装饰器 {'mat1': 'x', 'mat2': 'y'}; 新增out;
28 torch.angle @enkilee #77012 #806 #7705
paddle.angle c++下沉或装饰器 {'input': 'x'}; 新增out;
29 torch.as_strided @enkilee #77355 #7705
paddle.as_strided c++下沉或装饰器 {'input': 'x', 'size': 'shape', 'storage_offset': 'offset'};
30 torch.asin @Manfredss #76421 #759 #7643
paddle.asin c++下沉或装饰器 {'input': 'x'}; 新增out;
31 torch.asinh @Manfredss #76736 #785 #7668
paddle.asinh c++下沉或装饰器 {'input': 'x'}; 新增out;
32 torch.atan @Manfredss #76736 #785 #7668
paddle.atan c++下沉或装饰器 {'input': 'x'}; 新增out;
33 torch.atan2 @Manfredss #76736 #785 #7668
paddle.atan2 c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
34 torch.atanh @enkilee #76663 #7666 #786
paddle.atanh c++下沉或装饰器 {'input': 'x'}; 新增out;
35 torch.baddbmm @youge325 #76578 #77177 #7677 #798
paddle.baddbmm c++下沉或装饰器 {'batch1': 'x', 'batch2': 'y'}; 新增out;
36 torch.bernoulli @xunyoyo #77567
paddle.bernoulli c++下沉或装饰器 {'input': 'x'}; 新增out;
37 torch.bincount @Carousel126
paddle.bincount c++下沉或装饰器 {'input': 'x'};
38 torch.bitwise_and @youge325 #76705
paddle.bitwise_and c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
39 torch.bitwise_left_shift paddle.bitwise_left_shift c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
40 torch.bitwise_not paddle.bitwise_not c++下沉或装饰器 {'input': 'x'}; 新增out;
41 torch.bitwise_right_shift paddle.bitwise_right_shift c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
42 torch.bitwise_xor @Manfredss
paddle.bitwise_xor c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
43 torch.block_diag paddle.block_diag c++下沉或装饰器 {'tensors': 'inputs'};
44 torch.broadcast_tensors paddle.broadcast_tensors c++下沉或装饰器 {'tensors': 'input'};
45 torch.cartesian_prod @SidusAntares
paddle.cartesian_prod c++下沉或装饰器 {'tensors': 'x'};
46 torch.cdist paddle.cdist c++下沉或装饰器 {'x1': 'x', 'x2': 'y'};
47 torch.clone @liulin1124 #77780
@enkilee #78047
paddle.clone c++下沉或装饰器 {'input': 'x'};
48 torch.column_stack @enkilee #78069
paddle.column_stack c++下沉或装饰器 {'tensors': 'x'}; 新增out;
49 torch.combinations paddle.combinations c++下沉或装饰器 {'input': 'x'};
50 torch.conj @enkilee #77079 #7682 #806
paddle.conj c++下沉或装饰器 {'input': 'x'};
51 torch.copysign paddle.copysign c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
52 torch.cosh @algorithm1832 #76429 #7640 #766
paddle.cosh c++下沉或装饰器 {'input': 'x'}; 新增out;
53 torch.count_nonzero @MerlinSMQWQ #78077 #7806 #836
paddle.count_nonzero c++下沉或装饰器 {'input': 'x', 'dim': 'axis'};
54 torch.cross @pxzbest #77691
paddle.cross c++下沉或装饰器 {'input': 'x', 'other': 'y', 'dim': 'axis'}; 新增out;
55 torch.cummax @xcq-code #78081 #78183
paddle.cummax c++下沉或装饰器 {'input': 'x', 'dim': 'axis'}; 新增out;
56 torch.cummin @xcq-code #78081 #78183
paddle.cummin c++下沉或装饰器 {'input': 'x', 'dim': 'axis'}; 新增out;
57 torch.cumulative_trapezoid paddle.cumulative_trapezoid c++下沉或装饰器 {'dim': 'axis'};
58 torch.diag @algorithm1832 #76939 #7675 #792
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 torch.dist paddle.dist c++下沉或装饰器 {'input': 'x', 'other': 'y'};
62 torch.dsplit @enkilee #78048
paddle.dsplit c++下沉或装饰器 {'input': 'x', 'indices': 'num_or_indices', 'sections': 'num_or_indices'};
63 torch.dstack @enkilee #78069
paddle.dstack c++下沉或装饰器 {'tensors': 'x'}; 新增out;
64 torch.flip paddle.flip c++下沉或装饰器 {'input': 'x', 'dims': 'axis'};
65 torch.fmax paddle.fmax c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
66 torch.fmin paddle.fmin c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
67 torch.frac @algorithm1832 #76671 #7662 #784
paddle.frac c++下沉或装饰器 {'input': 'x'}; 新增out;
68 torch.frexp paddle.frexp c++下沉或装饰器 {'input': 'x'}; 新增out;
69 torch.gcd @Manfredss #76486 #7670 #787
paddle.gcd c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
70 torch.heaviside 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 #78048
paddle.hsplit c++下沉或装饰器 {'input': 'x', 'indices': 'num_or_indices', 'sections': 'num_or_indices'};
74 torch.hstack @enkilee #78069
paddle.hstack c++下沉或装饰器 {'tensors': 'x'}; 新增out;
75 torch.hypot @Khoray #78046 #833 #7851
@enkilee #78058
paddle.hypot c++下沉或装饰器 {'input': 'x', 'other': 'y'}; 新增out;
76 torch.iinfo @why1te
paddle.iinfo c++下沉或装饰器 {'type': 'dtype'};
77 torch.imag @liulin1124 #78038
paddle.imag c++下沉或装饰器 {'input': 'x'};
78 torch.index_add paddle.index_add c++下沉或装饰器 {'input': 'x', 'dim': 'axis'}; 新增out;
79 torch.index_fill 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 [#78181](https://github.com/P