-
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
转换规则 No. 126/128 #192
转换规则 No. 126/128 #192
Conversation
tests/test_cuda_get_rng_state_all.py
Outdated
""" | ||
import torch | ||
torch.cuda.get_rng_state_all() | ||
result = 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.
可以重写下compare函数,对get_rng_state_all输出结果进行判断下严格一些,可以判断是否属于Generator类型,参考paddle.seed
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.
已修改
from apibase import APIBase | ||
|
||
|
||
class GetRngStateAllAPIBase(APIBase): |
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.
这个有点奇特,因为返回的是Generator的list,paddle_result应该是一个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.
已修改使用 assert验证
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
126 torch.cuda.get_rng_state_all https://github.com/PaddlePaddle/docs/blob/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.get_rng_state_all.md
128 torch.cuda.set_rng_state_all https://github.com/PaddlePaddle/docs/blob/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.set_rng_state_all.md
PR APIs