-
Notifications
You must be signed in to change notification settings - Fork 166
Add deprecation warning for the functional API. #480
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
Comments
Add a flag to indicate deprecation and add a wrapper function to the |
I am thinking we can add a class attribute |
Doable, we still need to let |
…Pipe names" Fixes pytorch/data#480. For the list of deprecated DataPipes (or functional names), see pytorch/data#163 Testing: ```python IterableWrapper(range(10)).open_file_by_iopath() ``` Returns: ``` /Users/.../pytorch/torch/utils/data/datapipes/utils/common.py:171: FutureWarning: `IoPathFileOpener()`'s functional API `.open_file_by_iopath()` is deprecated since 1.12 and will be removed in 1.14. See pytorch/data#163 for details. Please use `.open_files_by_iopath()` instead. warnings.warn(msg, FutureWarning) ``` [ghstack-poisoned]
…Pipe names" Fixes pytorch/data#480. For the list of deprecated DataPipes (or functional names), see pytorch/data#163 Testing: ```python IterableWrapper(range(10)).open_file_by_iopath() ``` Returns: ``` /Users/.../pytorch/torch/utils/data/datapipes/utils/common.py:171: FutureWarning: `IoPathFileOpener()`'s functional API `.open_file_by_iopath()` is deprecated since 1.12 and will be removed in 1.14. See pytorch/data#163 for details. Please use `.open_files_by_iopath()` instead. warnings.warn(msg, FutureWarning) ``` [ghstack-poisoned]
…Pipe names" Fixes pytorch/data#480. For the list of deprecated DataPipes (or functional names), see pytorch/data#163 Testing: ```python IterableWrapper(range(10)).open_file_by_iopath() ``` Returns: ``` /Users/.../pytorch/torch/utils/data/datapipes/utils/common.py:171: FutureWarning: `IoPathFileOpener()`'s functional API `.open_file_by_iopath()` is deprecated since 1.12 and will be removed in 1.14. See pytorch/data#163 for details. Please use `.open_files_by_iopath()` instead. warnings.warn(msg, FutureWarning) ``` [ghstack-poisoned]
just to clarify, does this mean we should use the DataPipe class directly? the documentations seemed to suggest that functional form is recommended i.e. from my_custom_datapipes import MyDataPipe
dp = FileLister(...).filter(...)
dp = MyDataPipe(dp, **my_args)
# instead of
dp = dp.call_my_datapipe(**my_args) |
Nope. We still recommend to use functional api. Currently, |
Closing this issue as pytorch/pytorch#78970 has landed |
As a follow-up task, add deprecation warning for the functional API.
Originally posted by @ejguan in #479 (comment)
The text was updated successfully, but these errors were encountered: