-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【Hackathon 7th No.37】为 Paddle 代码转换工具新增 API 转换规则(第 4 组) #481
Changes from 12 commits
3ba9d2c
754006b
376663d
7c49e1f
699cb20
4ac7e22
74ad029
013c7fb
1a0fe37
e955a5a
dca6539
bd74a9c
e0362e7
71f7f77
8d7fe8f
d438a29
0c4c3d8
9faff94
23d1aa3
12d9e64
9596eb7
51743b8
adea30b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1796,10 +1796,50 @@ | |
"paddle_api": "paddle.Tensor.i0_", | ||
"min_input_args": 0 | ||
}, | ||
"torch.Tensor.igamma": {}, | ||
"torch.Tensor.igamma_": {}, | ||
"torch.Tensor.igammac": {}, | ||
"torch.Tensor.igammac_": {}, | ||
"torch.Tensor.igamma": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.gammainc", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"other" | ||
], | ||
"kwargs_change": { | ||
"other": "y" | ||
} | ||
}, | ||
"torch.Tensor.igamma_": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.gammainc_", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"other" | ||
], | ||
"kwargs_change": { | ||
"other": "y" | ||
} | ||
}, | ||
"torch.Tensor.igammac": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.gammaincc", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"other" | ||
], | ||
"kwargs_change": { | ||
"other": "y" | ||
} | ||
}, | ||
"torch.Tensor.igammac_": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.gammaincc_", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"other" | ||
], | ||
"kwargs_change": { | ||
"other": "y" | ||
} | ||
}, | ||
"torch.Tensor.index_add": { | ||
"Matcher": "IndexAddMatcher", | ||
"paddle_api": "paddle.Tensor.index_add", | ||
|
@@ -2398,7 +2438,11 @@ | |
"other": "y" | ||
} | ||
}, | ||
"torch.Tensor.matrix_exp": {}, | ||
"torch.Tensor.matrix_exp": { | ||
"Matcher": "TensorMatrixExpMatcher", | ||
"paddle_api": "paddle.linalg.matrix_exp", | ||
"min_input_args": 0 | ||
}, | ||
"torch.Tensor.matrix_power": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.matrix_power", | ||
|
@@ -2567,8 +2611,22 @@ | |
"vec" | ||
] | ||
}, | ||
"torch.Tensor.mvlgamma": {}, | ||
"torch.Tensor.mvlgamma_": {}, | ||
"torch.Tensor.mvlgamma": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.multigammaln", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"p" | ||
] | ||
}, | ||
"torch.Tensor.mvlgamma_": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.multigammaln_", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"p" | ||
] | ||
}, | ||
"torch.Tensor.nan_to_num": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.nan_to_num", | ||
|
@@ -2873,8 +2931,25 @@ | |
"force": "" | ||
} | ||
}, | ||
"torch.Tensor.orgqr": {}, | ||
"torch.Tensor.ormqr": {}, | ||
"torch.Tensor.orgqr": { | ||
"Matcher": "OrgqrMatcher", | ||
"paddle_api": "paddle.Tensor.householder_product", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"input2" | ||
] | ||
}, | ||
"torch.Tensor.ormqr": { | ||
"Matcher": "OrmqrMatcher", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个配置TensorFunc2PaddleFunc就可以吧 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个可以 |
||
"paddle_api": "paddle.linalg.ormqr", | ||
"min_input_args": 2, | ||
"args_list": [ | ||
"input2", | ||
"input3", | ||
"left", | ||
"transpose" | ||
] | ||
}, | ||
"torch.Tensor.outer": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.Tensor.outer", | ||
|
@@ -4007,6 +4082,14 @@ | |
"maxsplit" | ||
] | ||
}, | ||
"torch._assert": { | ||
"Matcher": "AssertMatcher", | ||
"min_input_args": 2, | ||
"args_list": [ | ||
"condition", | ||
"message" | ||
] | ||
}, | ||
"torch.abs": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.abs", | ||
|
@@ -8106,7 +8189,21 @@ | |
"input": "x" | ||
} | ||
}, | ||
"torch.linalg.cholesky_ex": {}, | ||
"torch.linalg.cholesky_ex": { | ||
"Matcher": "LinalgCholeskyExMatcher", | ||
"paddle_api": "paddle.linalg.cholesky", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"input", | ||
"*", | ||
"upper", | ||
"check_errors", | ||
"out" | ||
], | ||
"unsupport_args": [ | ||
"check_errors" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 文档改了这里不改? |
||
] | ||
}, | ||
"torch.linalg.cond": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.linalg.cond", | ||
|
@@ -8256,7 +8353,20 @@ | |
"A": "x" | ||
} | ||
}, | ||
"torch.linalg.inv_ex": {}, | ||
"torch.linalg.inv_ex": { | ||
"Matcher": "LinalgInvExMatcher", | ||
"paddle_api": "paddle.linalg.inv", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"A", | ||
"check_errors", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个不对吧,放在*的前后意义是不同的,是 位置参数 还是 指定关键字参数? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 他是指定关键字参数 |
||
"*", | ||
"out" | ||
], | ||
"unsupport_args": [ | ||
"check_errors" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 文档改了这里不改? |
||
] | ||
}, | ||
"torch.linalg.ldl_factor": {}, | ||
"torch.linalg.ldl_factor_ex": {}, | ||
"torch.linalg.ldl_solve": {}, | ||
|
@@ -9170,6 +9280,20 @@ | |
"input": "x" | ||
} | ||
}, | ||
"torch.mvlgamma": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.multigammaln", | ||
"min_input_args": 2, | ||
"args_list": [ | ||
"input", | ||
"p", | ||
"*", | ||
"out" | ||
], | ||
"kwargs_change": { | ||
"input": "x" | ||
} | ||
}, | ||
"torch.nan_to_num": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.nan_to_num", | ||
|
@@ -13937,6 +14061,18 @@ | |
"verbose" | ||
] | ||
}, | ||
"torch.ormqr": { | ||
"Matcher": "OrmqrMatcher", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个配置GenericMatcher就可以吧 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个也可以 |
||
"paddle_api": "paddle.linalg.ormqr", | ||
"min_input_args": 3, | ||
"args_list": [ | ||
"input", | ||
"input2", | ||
"input3", | ||
"left", | ||
"transpose" | ||
] | ||
}, | ||
"torch.outer": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.outer", | ||
|
@@ -15170,7 +15306,15 @@ | |
"input": "x" | ||
} | ||
}, | ||
"torch.special.ndtr": {}, | ||
"torch.special.ndtr": { | ||
"Matcher": "SpecialNdtrMatcher", | ||
"min_input_args": 1, | ||
"args_list": [ | ||
"input", | ||
"*", | ||
"out" | ||
] | ||
}, | ||
"torch.special.ndtri": { | ||
"Matcher": "SpecialNdtriMatcher", | ||
"min_input_args": 1, | ||
|
@@ -15650,6 +15794,26 @@ | |
"check_stride": "" | ||
} | ||
}, | ||
"torch.testing.make_tensor": { | ||
"Matcher": "MakeTMatcher", | ||
"min_input_args": 3, | ||
"args_list": [ | ||
"shape", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个看起来shape是 可变参数 或 位置参数 其他的应该是 指定关键字参数 所以应该这么写:
只看torch文档可能不精确 |
||
"device", | ||
"dtype", | ||
"low", | ||
"high", | ||
"requires_grad", | ||
"noncontiguous", | ||
"exclude_zero", | ||
"memory_format" | ||
], | ||
"unsupport_args": [ | ||
"noncontiguous", | ||
"exclude_zero", | ||
"memory_format" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这些其实没必要全部算作 无法支持,只有影响到网络计算的才算。 |
||
] | ||
}, | ||
"torch.tile": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.tile", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名
TensorOrgqrMatcher
吧