-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add nn.CircularPad{*}d for consistency + fix no_batch_dim support #106148
Add nn.CircularPad{*}d for consistency + fix no_batch_dim support #106148
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/106148
Note: Links to docs will display an error until the docs builds have been completed. ✅ 2 Unrelated FailuresAs of commit fa27baf: UNSTABLE - The following jobs failed but were likely due to flakiness present on trunk and has been marked as unstable:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ghstack-source-id: c34659c5956bbd8da30ff8edfb96ba98ef4c696f Pull Request resolved: #106148
…support" Fixes #105749 #95320 (tldr is that input should always be `[N, C, H, (W, D])` where only H, W and D dimensions get circular padding, so the 2D case where user wants both dimensions to be padded --> they should `.unsqueeze(0)` (as is the case for `Reflection/ReplicationPad`) but we didn't document this for circular padding Fixes no_batch_dim support #104860 - Adds missing documentation for circular padding - Adds missing CircularPad modules - Migrates legacy test_nn tests from circular padding to ModuleInfo - Adds no_batch_dim support + sample inputs that test this [ghstack-poisoned]
ghstack-source-id: de485a292145a993287b194d1c4c523c8fd14722 Pull Request resolved: #106148
…support" Fixes #105749 #95320 (tldr is that input should always be `[N, C, H, (W, D])` where only H, W and D dimensions get circular padding, so the 2D case where user wants both dimensions to be padded --> they should `.unsqueeze(0)` (as is the case for `Reflection/ReplicationPad`) but we didn't document this for circular padding Fixes no_batch_dim support #104860 - Adds missing documentation for circular padding - Adds missing CircularPad modules - Migrates legacy test_nn tests from circular padding to ModuleInfo - Adds no_batch_dim support + sample inputs that test this [ghstack-poisoned]
ghstack-source-id: 5c1f88340ac04a2d1226591377f4f8dc1924cae9 Pull Request resolved: #106148
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.
Very nice update to the kernel and love to see more testing!
…support" Fixes #105749 #95320 (tldr is that input should always be `[N, C, H, (W, D])` where only H, W and D dimensions get circular padding, so the 2D case where user wants both dimensions to be padded --> they should `.unsqueeze(0)` (as is the case for `Reflection/ReplicationPad`) but we didn't document this for circular padding. [This seems to be the old docstring](https://github.com/pytorch/pytorch/blob/277b05014aced075337d6f84a535bd5150aabebb/torch/nn/functional.py#L4689) that was somehow lost. Fixes no_batch_dim support #104860 - Adds missing documentation for circular padding - Adds missing CircularPad modules - Migrates legacy test_nn tests from circular padding to ModuleInfo - Adds no_batch_dim support + sample inputs that test this [ghstack-poisoned]
ghstack-source-id: 3d85cb966098c3c9c557b67813d28efcabdda697 Pull Request resolved: #106148
…support" Fixes #105749 #95320 (tldr is that input should always be `[N, C, H, (W, D])` where only H, W and D dimensions get circular padding, so the 2D case where user wants both dimensions to be padded --> they should `.unsqueeze(0)` (as is the case for `Reflection/ReplicationPad`) but we didn't document this for circular padding. [This seems to be the old docstring](https://github.com/pytorch/pytorch/blob/277b05014aced075337d6f84a535bd5150aabebb/torch/nn/functional.py#L4689) that was somehow lost. Fixes no_batch_dim support #104860 - Adds missing documentation for circular padding - Adds missing CircularPad modules - Migrates legacy test_nn tests from circular padding to ModuleInfo - Adds no_batch_dim support + sample inputs that test this [ghstack-poisoned]
ghstack-source-id: 3a7ed23df9172f5d2b175853a94a077d7b512d6a Pull Request resolved: #106148
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.
SGTM
…support" Fixes #105749 #95320 (tldr is that input should always be `[N, C, H, (W, D])` where only H, W and D dimensions get circular padding, so the 2D case where user wants both dimensions to be padded --> they should `.unsqueeze(0)` (as is the case for `Reflection/ReplicationPad`) but we didn't document this for circular padding. [This seems to be the old docstring](https://github.com/pytorch/pytorch/blob/277b05014aced075337d6f84a535bd5150aabebb/torch/nn/functional.py#L4689) that was somehow lost. Fixes no_batch_dim support #104860 - Adds missing documentation for circular padding - Adds missing CircularPad modules - Migrates legacy test_nn tests from circular padding to ModuleInfo - Adds no_batch_dim support + sample inputs that test this cc albanD mruberry jbschlosser walterddr [ghstack-poisoned]
ghstack-source-id: 21212ba64b7c2ec1aef19c6c92dc4e6aaf361958 Pull Request resolved: #106148
…support" Fixes #105749 #95320 (tldr is that input should always be `[N, C, H, (W, D])` where only H, W and D dimensions get circular padding, so the 2D case where user wants both dimensions to be padded --> they should `.unsqueeze(0)` (as is the case for `Reflection/ReplicationPad`) but we didn't document this for circular padding. [This seems to be the old docstring](https://github.com/pytorch/pytorch/blob/277b05014aced075337d6f84a535bd5150aabebb/torch/nn/functional.py#L4689) that was somehow lost. Fixes no_batch_dim support #104860 - Adds missing documentation for circular padding - Adds missing CircularPad modules - Migrates legacy test_nn tests from circular padding to ModuleInfo - Adds no_batch_dim support + sample inputs that test this cc albanD mruberry jbschlosser walterddr [ghstack-poisoned]
ghstack-source-id: 1c6ac41aea84e103f881358f66fb2bc7809cd761 Pull Request resolved: #106148
@pytorchbot merge |
…support" Fixes #105749 #95320 (tldr is that input should always be `[N, C, H, (W, D])` where only H, W and D dimensions get circular padding, so the 2D case where user wants both dimensions to be padded --> they should `.unsqueeze(0)` (as is the case for `Reflection/ReplicationPad`) but we didn't document this for circular padding. [This seems to be the old docstring](https://github.com/pytorch/pytorch/blob/277b05014aced075337d6f84a535bd5150aabebb/torch/nn/functional.py#L4689) that was somehow lost. Fixes no_batch_dim support #104860 - Adds missing documentation for circular padding - Adds missing CircularPad modules - Migrates legacy test_nn tests from circular padding to ModuleInfo - Adds no_batch_dim support + sample inputs that test this cc albanD mruberry jbschlosser walterddr [ghstack-poisoned]
ghstack-source-id: 5ef5cc48081275f0bbfb9368aa41da94372851b9 Pull Request resolved: #106148
Merge failedReason: New commits were pushed while merging. Please rerun the merge command. Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: Command
Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
@pytorchbot revert -m "Reverting as dependent PR #106147 was reverted as well" -c weird |
@pytorchbot successfully started a revert job. Check the current status here. |
@mikaylagawarecki your PR has been successfully reverted. |
…port (#106148)" This reverts commit 87d2536. Reverted #106148 on behalf of https://github.com/malfet due to Reverting as dependent PR #106147 was reverted as well ([comment](#106148 (comment)))
…port (#106148)" [ghstack-poisoned]
…tch_dim support (#106148)"" Previous one was reverted because the PR stacked under which added error-checking to Pad variants #106147 was reverted as internally some people pass 2D inputs to ZeroPad2d (which should actually take 3d or 4d inputs :) but there wasn't actually anything this PR was breaking according to my understanding [ghstack-poisoned]
…port (#106148)" (#106632) Previous one was reverted because the PR stacked under which added error-checking to Pad variants #106147 was reverted as internally some people pass 2D inputs to ZeroPad2d (which should actually take 3d or 4d inputs :) but there wasn't actually anything this PR was breaking according to my understanding Pull Request resolved: #106632 Approved by: https://github.com/albanD
…port (pytorch#106148)" (pytorch#106632) Previous one was reverted because the PR stacked under which added error-checking to Pad variants pytorch#106147 was reverted as internally some people pass 2D inputs to ZeroPad2d (which should actually take 3d or 4d inputs :) but there wasn't actually anything this PR was breaking according to my understanding Pull Request resolved: pytorch#106632 Approved by: https://github.com/albanD
Fixes #105749 #95320
(tldr is that input should always be
[N, C, H, (W, D])
where only H, W and D dimensions get circular padding, so the 2D case where user wants both dimensions to be padded --> they should.unsqueeze(0)
(as is the case forReflection/ReplicationPad
) but we didn't document this for circular padding. This seems to be the old docstring that was somehow lost.Fixes no_batch_dim support #104860
Stack from ghstack (oldest at bottom):
cc @albanD @mruberry @jbschlosser @walterddr