Skip to content

Commit

Permalink
【Hackathon 7th No.35】为 Paddle 代码转换工具新增 API 转换规则(第 2 组) (#488)
Browse files Browse the repository at this point in the history
* 【Hackathon 7th No.35】为 Paddle 代码转换工具新增 API 转换规则(第 2 组)

* update TensorTransposeMatcher

* update AddMRMatcherAddMR_Matcher

* revert 'update AddMRMatcherAddMR_Matcher'

* fix ci

---------

Co-authored-by: zhwesky2010 <1183042833@qq.com>
  • Loading branch information
ccsuzzh and zhwesky2010 authored Oct 9, 2024
1 parent 8c3ac3d commit c06c5ab
Show file tree
Hide file tree
Showing 17 changed files with 1,169 additions and 39 deletions.
138 changes: 124 additions & 14 deletions paconvert/api_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,17 @@
"alpha"
]
},
"torch.Tensor.addbmm_": {},
"torch.Tensor.addbmm_": {
"Matcher": "AddBmm_Matcher",
"min_input_args": 2,
"args_list": [
"batch1",
"batch2",
"*",
"beta",
"alpha"
]
},
"torch.Tensor.addcdiv": {
"Matcher": "AddCDivMatcher",
"min_input_args": 2,
Expand All @@ -312,7 +322,16 @@
"value"
]
},
"torch.Tensor.addcdiv_": {},
"torch.Tensor.addcdiv_": {
"Matcher": "AddCDiv_Matcher",
"min_input_args": 2,
"args_list": [
"tensor1",
"tensor2",
"*",
"value"
]
},
"torch.Tensor.addcmul": {
"Matcher": "AddCMulMatcher",
"min_input_args": 2,
Expand Down Expand Up @@ -377,7 +396,18 @@
"alpha"
]
},
"torch.Tensor.addmv_": {},
"torch.Tensor.addmv_": {
"Matcher": "AddMR_Matcher",
"paddle_api": "paddle.mm",
"min_input_args": 2,
"args_list": [
"mat",
"vec",
"*",
"beta",
"alpha"
]
},
"torch.Tensor.addr": {
"Matcher": "AddMRMatcher",
"paddle_api": "paddle.outer",
Expand All @@ -390,7 +420,18 @@
"alpha"
]
},
"torch.Tensor.addr_": {},
"torch.Tensor.addr_": {
"Matcher": "AddMR_Matcher",
"paddle_api": "paddle.outer",
"min_input_args": 2,
"args_list": [
"vec1",
"vec2",
"*",
"beta",
"alpha"
]
},
"torch.Tensor.adjoint": {
"Matcher": "AdjointMatcher",
"min_input_args": 0
Expand Down Expand Up @@ -636,7 +677,18 @@
"alpha"
]
},
"torch.Tensor.baddbmm_": {},
"torch.Tensor.baddbmm_": {
"Matcher": "AddMR_Matcher",
"paddle_api": "paddle.bmm",
"min_input_args": 2,
"args_list": [
"batch1",
"batch2",
"*",
"beta",
"alpha"
]
},
"torch.Tensor.bernoulli": {
"Matcher": "TensorFunc2PaddleFunc",
"paddle_api": "paddle.bernoulli",
Expand Down Expand Up @@ -950,8 +1002,28 @@
"non_blocking": ""
}
},
"torch.Tensor.copysign": {},
"torch.Tensor.copysign_": {},
"torch.Tensor.copysign": {
"Matcher": "Num2TensorBinaryMatcher",
"paddle_api": "paddle.Tensor.copysign",
"min_input_args": 1,
"args_list": [
"other"
],
"kwargs_change": {
"other": "y"
}
},
"torch.Tensor.copysign_": {
"Matcher": "Num2TensorBinaryMatcher",
"paddle_api": "paddle.Tensor.copysign_",
"min_input_args": 1,
"args_list": [
"other"
],
"kwargs_change": {
"other": "y"
}
},
"torch.Tensor.corrcoef": {
"Matcher": "GenericMatcher",
"paddle_api": "paddle.Tensor.corrcoef",
Expand Down Expand Up @@ -1350,7 +1422,10 @@
"Matcher": "ErfCMatcher",
"min_input_args": 0
},
"torch.Tensor.erfc_": {},
"torch.Tensor.erfc_": {
"Matcher": "ErfC_Matcher",
"min_input_args": 0
},
"torch.Tensor.erfinv": {
"Matcher": "GenericMatcher",
"paddle_api": "paddle.Tensor.erfinv",
Expand Down Expand Up @@ -1440,7 +1515,11 @@
"paddle_api": "paddle.Tensor.trunc",
"min_input_args": 0
},
"torch.Tensor.fix_": {},
"torch.Tensor.fix_": {
"Matcher": "GenericMatcher",
"paddle_api": "paddle.Tensor.trunc_",
"min_input_args": 0
},
"torch.Tensor.flatten": {
"Matcher": "GenericMatcher",
"paddle_api": "paddle.Tensor.flatten",
Expand Down Expand Up @@ -1568,7 +1647,17 @@
"other": "y"
}
},
"torch.Tensor.fmod_": {},
"torch.Tensor.fmod_": {
"Matcher": "Num2TensorBinaryMatcher",
"paddle_api": "paddle.Tensor.mod_",
"min_input_args": 1,
"args_list": [
"other"
],
"kwargs_change": {
"other": "y"
}
},
"torch.Tensor.frac": {
"Matcher": "GenericMatcher",
"paddle_api": "paddle.Tensor.frac",
Expand Down Expand Up @@ -3362,7 +3451,10 @@
"Matcher": "SincMatcher",
"min_input_args": 0
},
"torch.Tensor.sinc_": {},
"torch.Tensor.sinc_": {
"Matcher": "SincMatcher",
"min_input_args": 0
},
"torch.Tensor.sinh": {
"Matcher": "UnchangeMatcher",
"min_input_args": 0
Expand Down Expand Up @@ -3607,7 +3699,11 @@
"paddle_api": "paddle.Tensor.t",
"min_input_args": 0
},
"torch.Tensor.t_": {},
"torch.Tensor.t_": {
"Matcher": "GenericMatcher",
"paddle_api": "paddle.Tensor.t_",
"min_input_args": 0
},
"torch.Tensor.take": {
"Matcher": "TensorTakeMatcher",
"paddle_api": "paddle.Tensor.take",
Expand Down Expand Up @@ -3733,7 +3829,15 @@
"dim1"
]
},
"torch.Tensor.transpose_": {},
"torch.Tensor.transpose_": {
"Matcher": "TensorTransposeMatcher",
"paddle_api": "paddle.Tensor.transpose_",
"min_input_args": 2,
"args_list": [
"dim0",
"dim1"
]
},
"torch.Tensor.triangular_solve": {
"Matcher": "TensorTriangularSolveMatcher",
"paddle_api": "paddle.linalg.triangular_solve",
Expand Down Expand Up @@ -3993,7 +4097,13 @@
"other"
]
},
"torch.Tensor.xlogy_": {},
"torch.Tensor.xlogy_": {
"Matcher": "XLogY_Matcher",
"min_input_args": 1,
"args_list": [
"other"
]
},
"torch.Tensor.zero_": {
"Matcher": "GenericMatcher",
"paddle_api": "paddle.Tensor.zero_",
Expand Down
Loading

0 comments on commit c06c5ab

Please sign in to comment.