-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[API Compatibility] Add function alias for Dataset, IterableDataset and ConcatDataset
#77212
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
[API Compatibility] Add function alias for Dataset, IterableDataset and ConcatDataset
#77212
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
| _T = TypeVar('_T') | ||
|
|
||
|
|
||
| class Dataset(Generic[_T]): |
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.
实际上是函数别名,理论上在此处直接import就可以,不需要额外代码
但是直接import会出现循环依赖(现在这份代码其实也存在循环依赖,还在排查)
直接import出现循环依赖的原因是:paddle.base初始化的时候,会调用utils里面的一个函数,但utils里面import Dataset会进一步import paddle.base,从而导致循环依赖
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #77212 +/- ##
==========================================
Coverage ? 40.74%
==========================================
Files ? 3
Lines ? 54
Branches ? 0
==========================================
Hits ? 22
Misses ? 32
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
这个可能得设计一下这个import关系,比如解耦一些依赖。 |
|
utils可能需要重构,短时间内无法完成本PR涉及的API兼容性工作 |
PR Category
User Experience
PR Types
Improvements
Description
paddle.iotopaddle.utils.dataUsed AI Studio
Notes:
TestTensorDatasetfailed due to tensor shape mismatch (but it has nothing to do with this PR)import, a circular import problem will raise, becausepaddle.baseimports function fromutils, and the dataset classes inpaddle.ioimportpaddle.base