-
Notifications
You must be signed in to change notification settings - Fork 55
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
转换规则 No.43/97/98/100 #263
转换规则 No.43/97/98/100 #263
Conversation
Thanks for your contribution! |
paconvert/api_matcher.py
Outdated
|
||
API_TEMPLATE = textwrap.dedent( | ||
""" | ||
paddle.reshape({}, {}.shape) |
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.
torch的是不是inplace的操作?更适合reshape_
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.
已修改
paconvert/api_mapping.json
Outdated
@@ -2027,7 +2036,12 @@ | |||
"out" | |||
] | |||
}, | |||
"torch.Tensor.round_": {}, | |||
"torch.Tensor.round_": { | |||
"Matcher": "TensorRoundMatcher", |
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.
这个是inplace操作的,还不能直接用非inplace的API,inplace操作是指会原位操作:
y = paddle.abs_(x) # x自身被修改,返回x
y = paddle.abs(x) # x不会被修改,返回一个新的Tensor
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.
已修改使用paddle.assign
paconvert/api_matcher.py
Outdated
if "decimals" in kwargs: | ||
API_TEMPLATE = textwrap.dedent( | ||
""" | ||
paddle.assign(paddle.round((10**{}) * {}) / (10**{}), {}) |
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.
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.
已修改
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.
LGTM
PR Docs
#112
97 torch.Tensor.resize_as_ 映射文档 PaddlePaddle/docs#6149
98 torch.Tensor.round_ 已有文档验证无误
100 torch.Tensor.scatter_add 已有文档验证无误
43 torch.nn.Threshold 已有文档验证无误
PR APIs