-
Notifications
You must be signed in to change notification settings - Fork 89
[API compatibility] Add nn.Module,nn.ModuleList,nn,ModuleDict #756
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for your contribution! |
tests/test_nn_Module_zero_grad.py
Outdated
|
|
||
|
|
||
| def test_case_1(): | ||
| def _test_case_1(): |
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有问题吗
9c8d6e9 to
eb54811
Compare
| import pytest | ||
| from apibase import APIBase | ||
|
|
||
| # 本地测试通过,paconvert中api_mapping中会将torch.Tensor.cuda进行转换,导致出现不存在参数device_id |
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.Tensor.cuda未对齐的原因吗
| if self.get_paddle_api(): | ||
| new_paddle_api = re.sub( | ||
| "paddle.Tensor|paddle.nn.Layer|paddle.optimizer.Optimizer|paddle.distribution.Distribution|paddle.autograd.PyLayerContext|paddle.profiler.Profiler", | ||
| "paddle.Tensor|paddle.nn.Layer|paddle.nn.Module|paddle.optimizer.Optimizer|paddle.distribution.Distribution|paddle.autograd.PyLayerContext|paddle.profiler.Profiler", |
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.
|
|
||
|
|
||
| def _test_case_1(): | ||
| def test_case_1(): |
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.Tensor.sub", | ||
| "torch.Tensor.sub_", | ||
| "torch.Tensor.random_", | ||
| "torch.meshgrid", |
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.
确认下:所有能对齐的都填上了吧,另外都存在单测吧

PR Docs
新增nn.Module,nn.ModuleList,nn,ModuleDict和torch.meshgrid
其中nn.Module.zero_grad中不支持直接将p.grad设置为None,当前使用clear_gradient代替。
PR APIs