-
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. 181-184 #195
转换规则 No. 181-184 #195
Conversation
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.
这一系列API路径太长了,建议都实现torch.distributions.*的简洁调用,然后通过 api_alias_mapping.sjon 来配置更长的别名。
对于单测的话只共用一个文件,主要实现简洁的主调用,对于别名加一两个test_alias_case就可以
pytorch_code = textwrap.dedent( | ||
""" | ||
import torch | ||
base_distribution = torch.distributions.normal.Normal(torch.tensor([0.0]), torch.tensor([1.0])) |
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.
已修改
paconvert/api_mapping.json
Outdated
"cache_size": "" | ||
} | ||
}, | ||
"torch.distributions.uniform.Uniform": { |
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.
这种API看起来别名很长,可以简洁调用,可以用 api_alias_mapping.json
配置一下
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.
已修改
obj.run(pytorch_code, ["result"], check_value=False) | ||
|
||
|
||
def test_case_3(): |
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.
这个测试case,看起来和上面那个测试case没什么区别
我先合入了,后面可以看看
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.distributions.Uniform
torch.distributions.uniform.Uniform
PR Docs
#112
文档 PaddlePaddle/docs#6044
torch.distributions.transforms.SoftmaxTransform 为测试用例使用增加
PR APIs