[API Compatibility] add device/dtype/bias paramters and its unit test for nn.Conv1/2/3D/nn.Embedding by zhiminzhang0830 · Pull Request #74641 · PaddlePaddle/Paddle
PR Category
User Experience
PR Types
New features
Description
add device/dtype/bias paramters for nn.Conv1/2/3D, nn.Embedding
add new api: paddle.nn.Conv1/2/3d
pcard-67164
你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.
| weight_attr: ParamAttrLike | None = None, | ||
| bias_attr: ParamAttrLike | None = None, | ||
| data_format: DataLayout3D = "NCDHW", | ||
| device: str | PlaceLike | None = None, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个位置如果插入到前面去,和torch保持位置一致,不兼容影响大吗
| return _C_ops.add(pre_bias, bias) | ||
| else: | ||
| return pre_bias | ||
| with ( |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只改变weight、bias的device,这里中间计算过程的place要改变吗
| param = param.to(device) | ||
| return param | ||
| else: | ||
| if in_pir_mode(): |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
老静态图可以不管,pir支持device吗
Codecov Report
✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@4d37570). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@ ## develop #74641 +/- ## =========================================== Coverage ? 100.00% =========================================== Files ? 3 Lines ? 38 Branches ? 0 =========================================== Hits ? 38 Misses ? 0 Partials ? 0
☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
zhiminzhang0830
changed the title
add device/dtype/bias paramters and its unit test for nn.Conv3D
[API Compatibility] add device/dtype/bias paramters and its unit test for nn.Conv3D
zhiminzhang0830
changed the title
[API Compatibility] add device/dtype/bias paramters and its unit test for nn.Conv3D
[API Compatibility] add device/dtype/bias paramters and its unit test for nn.Conv1/2/3D/nn.Embedding
| embedding_dim, | ||
| ], "Shape of weight does not match num_embeddings and embedding_dim" | ||
| self._weight_attr = ParamAttr( | ||
| initializer=paddle.nn.initializer.Assign(value=_weight), |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是不是这样可实现:
_weight.stop_gradient = _freeze
self._weight = _weight
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| sparse: bool = False, | ||
| _weight: Tensor | None = None, | ||
| _freeze: bool = False, | ||
| device: str | PlaceLike | None = None, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| device: str | PlaceLike | None = None, | |
| device: PlaceLike | None = None, |
PlaceLike 包含 str
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下同,其他地方不一一指出
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改,辛苦再review下
| weight_attr: ParamAttrLike | None = None, | ||
| bias_attr: ParamAttrLike | None = None, | ||
| data_format: DataLayoutND = "NCHW", | ||
| device: str | PlaceLike | None = None, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里还没改
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters