-
Notifications
You must be signed in to change notification settings - Fork 360
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
Warn and ignore "drop_last" when set in DPDataLoader #357
Conversation
This pull request was exported from Phabricator. Differential Revision: D34197820 |
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.
Hi @gautham-kollu , thanks for taking this up. I just added a couple of nits, looks good otherwise. Happy to approve after the changes :)
opacus/data_loader.py
Outdated
@@ -143,13 +144,15 @@ def __init__( | |||
if collate_fn is None: | |||
collate_fn = default_collate | |||
|
|||
if drop_last: | |||
warnings.warn("Ignoring drop_last as it is not compatible with DPDataLoader.") |
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.
opacus/tests/dpdataloader_test.py
Outdated
|
||
dataset = TensorDataset(x) | ||
data_loader = DataLoader(dataset, drop_last=True) | ||
dp_data_loader = DPDataLoader.from_data_loader(data_loader) |
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.
nit: pacify linter
dp_data_loader = DPDataLoader.from_data_loader(data_loader) | |
_ = DPDataLoader.from_data_loader(data_loader) |
Summary: Pull Request resolved: pytorch#357 Add a warning to show "drop_last" is being ignored and is not compatible with DPDataLoader Differential Revision: D34197820 fbshipit-source-id: 6e7d1ba69c6018a4219bc9e8640c61fac806f8cf
23d1f7c
to
5a11b36
Compare
This pull request was exported from Phabricator. Differential Revision: D34197820 |
Summary: Pull Request resolved: pytorch#357 Add a warning to show "drop_last" is being ignored and is not compatible with DPDataLoader Differential Revision: D34197820 fbshipit-source-id: 1ff0b0ac4a0b4b6248e6b95e532a928e0ef0be02
5a11b36
to
40c6219
Compare
This pull request was exported from Phabricator. Differential Revision: D34197820 |
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.
Thanks again!
Summary: Add a warning to show "drop_last" is being ignored and is not compatible with DPDataLoader
Differential Revision: D34197820