-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add unit test for nested_tensor input to nn.TransformerEncoder #100650
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/100650
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 7328bed: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D45580393 |
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.
Why not just move the output.size()
call here:
pytorch/torch/nn/modules/transformer.py
Lines 318 to 319 in 8994d9e
if convert_to_nested: | |
output = output.to_padded_tensor(0., output_size) |
output_size
isn't used anywhere else AFAICT.
Good point! One consideration - do we benefit from not having src live until the end of the TransformerEncoder stack? |
Maybe something like this: if convert_to_nested:
output = output.to_padded_tensor(0., src.size()) |
Yes, this makes sense - great point and simplifies code! Would increasing the defined-use range for src across TransformerEncoder be a concern? |
This pull request was exported from Phabricator. Differential Revision: D45580393 |
This pull request was exported from Phabricator. Differential Revision: D45580393 |
@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: 1 jobs have failed, first few of them are: trunk / macos-12-py3-arm64 / test (default, 2, 3, macos-m1-12) Details for Dev Infra teamRaised by workflow job |
This pull request was exported from Phabricator. Differential Revision: D45580393 |
This pull request was exported from Phabricator. Differential Revision: D45580393 |
2c092c0
to
301d1d2
Compare
This pull request was exported from Phabricator. Differential Revision: D45580393 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D45580393 |
Summary: Pull Request resolved: pytorch#100650 Add unit test for nested_tensor input & fix Test Plan: sandcastle Differential Revision: D45580393 fbshipit-source-id: 2f5d5ac1064c8810d28d11fa769fd2ff34693b2b
This pull request was exported from Phabricator. Differential Revision: D45580393 |
This pull request was exported from Phabricator. Differential Revision: D45580393 |
Summary: Pull Request resolved: pytorch#100650 Add unit test for nested_tensor input & fix Test Plan: sandcastle Differential Revision: D45580393 fbshipit-source-id: bbbee84c004c928b55870ac60970a8d38c0cba0e
This pull request was exported from Phabricator. Differential Revision: D45580393 |
@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 |
Summary: Add unit test for nested_tensor input & fix
Test Plan: sandcastle
Differential Revision: D45580393