-
Notifications
You must be signed in to change notification settings - Fork 42
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.208/220 #210
转换规则 No.208/220 #210
Conversation
Thanks for your contribution! |
paconvert/api_mapping.json
Outdated
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.linalg.cond", | ||
"args_list": [ | ||
"A", |
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.linalg.cond(A, p=None, *, out=None)
吗
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文档里写的是A,测试参数名称是input
https://github.com/pytorch/pytorch/blob/16df54239fecb97afbda30026931bbcac09542c4/aten/src/ATen/native/native_functions.yaml#L13603
torch代码没有使用Tensor A
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.
@co63oc 那这个args_list应该是 input、p、out
吧
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.
已修改,保留A是不确定torch不同版本是否不同
"torch.linalg.cond": { | ||
"Matcher": "GenericMatcher", | ||
"paddle_api": "paddle.linalg.cond", | ||
"args_list": [ |
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.
那这个args_list应该是 input、p、out 吧
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.
已修改
tests/test_linalg_cond.py
Outdated
import torch | ||
x = torch.tensor([[1., 0, -1], [0, 1, 0], [1, 0, 1]]) | ||
out = torch.tensor([]) | ||
result = torch.linalg.cond(x, p=float('inf'), out=out) |
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
208 torch.linalg.cond https://github.com/PaddlePaddle/docs/blob/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/linalg/torch.linalg.cond.md
测试时torch参数名称input,增加input参数项映射
220 torch.nn.init.calculate_gain https://github.com/PaddlePaddle/docs/blob/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/init/torch.nn.init.calculate_gain.md
PR APIs