fix set_data permitting requires_grad=True on integer tensor#78436
fix set_data permitting requires_grad=True on integer tensor#78436yuguo68 wants to merge 4 commits intogh/yuguo68/6/basefrom
Conversation
[ghstack-poisoned]
🔗 Helpful links
❌ 1 New FailuresAs of commit 4c022d6 (more details on the Dr. CI page): Expand to see more
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
…on integer tensor" fix #76008 [ghstack-poisoned]
albanD
left a comment
There was a problem hiding this comment.
That makes sense to me as a fix even though it is BC-breaking.
cc @soulitzer do you agree?
| # Calls model with a LongTensor input but DoubleTensor weights | ||
| input = torch.randn(1, 1, 1, 6, dtype=torch.double) | ||
| weight = torch.zeros(1, 1, 1, 3, dtype=torch.long) | ||
| weight = torch.zeros(1, 1, 1, 3, dtype=torch.complex64) |
There was a problem hiding this comment.
Since torch.long does not support grad, with this PR, this test will fail at this assignment. However, the original test fails at out = model(input) with a dtype mismatch error.
There was a problem hiding this comment.
Ho right. That sounds good!
albanD
left a comment
There was a problem hiding this comment.
SGTM
I'll let @soulitzer take a look and merge if he's happy with this!
soulitzer
left a comment
There was a problem hiding this comment.
Thanks for the change! Just a small nit on the wording.
Yup, SGTM as well |
…True on integer tensor" fix #76008 [ghstack-poisoned]
…ad=True on integer tensor" fix #76008 [ghstack-poisoned]
|
@yuguo68 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
@yuguo68 why did you import this, are there fb-only changes that need to be made? |
just want to check whether it causes internal test errors in advance, will use pytorchbot to merge. |
|
@pytorchbot merge this |
|
Hey @yuguo68. |
Summary: Pull Request resolved: #78436 Approved by: https://github.com/albanD, https://github.com/soulitzer Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/efdb4192bc9620a9ef93fe2fc18969af42a2ebfb Reviewed By: seemethere Differential Revision: D36800179 Pulled By: yuguo68 fbshipit-source-id: e8a92d3e9412a462cff1cebf8e74f1e7213cdac6
Fixes #79871 Make `module.cpp` tests respect change that was made in #78436 (no int types in autograd). Note that there still a gap in Cmake test -- it's unclear why it didn't fail CI before. As far as I can tell it should be executed, because it's included here https://github.com/pytorch/pytorch/blob/79507d2a9d06d4a3fb50eb21b30e08cc044776ce/test/cpp/api/CMakeLists.txt#L17:L17 Pull Request resolved: #79926 Approved by: https://github.com/soulitzer
Summary: Fixes #79871 Make `module.cpp` tests respect change that was made in #78436 (no int types in autograd). Note that there still a gap in Cmake test -- it's unclear why it didn't fail CI before. As far as I can tell it should be executed, because it's included here https://github.com/pytorch/pytorch/blob/79507d2a9d06d4a3fb50eb21b30e08cc044776ce/test/cpp/api/CMakeLists.txt#L17:L17 Pull Request resolved: #79926 Approved by: https://github.com/soulitzer Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/a8b098859688a3f1993821eecc036be973a15605 Reviewed By: atalman Differential Revision: D37333256 Pulled By: atalman fbshipit-source-id: 0b914fbcc5da72fbadf0f3c2f6b6af1a198cf6fb
Fixes pytorch#79871 Make `module.cpp` tests respect change that was made in pytorch#78436 (no int types in autograd). Note that there still a gap in Cmake test -- it's unclear why it didn't fail CI before. As far as I can tell it should be executed, because it's included here https://github.com/pytorch/pytorch/blob/79507d2a9d06d4a3fb50eb21b30e08cc044776ce/test/cpp/api/CMakeLists.txt#L17:L17 Pull Request resolved: pytorch#79926 Approved by: https://github.com/soulitzer
Pull Request resolved: pytorch#78436 Approved by: https://github.com/albanD, https://github.com/soulitzer
Fixes pytorch#79871 Make `module.cpp` tests respect change that was made in pytorch#78436 (no int types in autograd). Note that there still a gap in Cmake test -- it's unclear why it didn't fail CI before. As far as I can tell it should be executed, because it's included here https://github.com/pytorch/pytorch/blob/e4a7ecafa61d9d9a7ac1f154264d6f5ccffe12bb/test/cpp/api/CMakeLists.txt#L17:L17 Pull Request resolved: pytorch#79926 Approved by: https://github.com/soulitzer
Stack from ghstack (oldest at bottom):
fix #76008
Differential Revision: D36800179