Repository navigation
Conversation
Previously, torch.Tensor was treated as if it were torch.FloatTensor (where Float is whatever the default dtype was). This is not good behavior for tensor subclasses, which inherit from torch.Tensor and will want to super() call into it and will only notice later that only float works as a dtype. So in this PR I relax the behavior for this case to make the torch.Tensor constructor more useful for subclasses. Signed-off-by: Edward Z. Yang <[email protected]> [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
|
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 1ec06f7 (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
Previously, torch.Tensor was treated as if it were torch.FloatTensor (where Float is whatever the default dtype was). This is not good behavior for tensor subclasses, which inherit from torch.Tensor and will want to super() call into it and will only notice later that only float works as a dtype. So in this PR I relax the behavior for this case to make the torch.Tensor constructor more useful for subclasses. Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
Previously, torch.Tensor was treated as if it were torch.FloatTensor (where Float is whatever the default dtype was). This is not good behavior for tensor subclasses, which inherit from torch.Tensor and will want to super() call into it and will only notice later that only float works as a dtype. So in this PR I relax the behavior for this case to make the torch.Tensor constructor more useful for subclasses. Signed-off-by: Edward Z. Yang <ezyangfb.com> ghstack-source-id: 656b68b Pull Request resolved: #73850
Previously, torch.Tensor was treated as if it were torch.FloatTensor (where Float is whatever the default dtype was). This is not good behavior for tensor subclasses, which inherit from torch.Tensor and will want to super() call into it and will only notice later that only float works as a dtype. So in this PR I relax the behavior for this case to make the torch.Tensor constructor more useful for subclasses. Signed-off-by: Edward Z. Yang <ezyangfb.com> [ghstack-poisoned]
|
test added |
|
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Pull Request resolved: #73850 Previously, torch.Tensor was treated as if it were torch.FloatTensor (where Float is whatever the default dtype was). This is not good behavior for tensor subclasses, which inherit from torch.Tensor and will want to super() call into it and will only notice later that only float works as a dtype. So in this PR I relax the behavior for this case to make the torch.Tensor constructor more useful for subclasses. Signed-off-by: Edward Z. Yang <[email protected]> Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D34707396 Pulled By: ezyang fbshipit-source-id: a995d601007b6fcd0317d89f66ca7e08c4d6053e
Stack from ghstack (oldest at bottom):
Previously, torch.Tensor was treated as if it were torch.FloatTensor
(where Float is whatever the default dtype was). This is not good
behavior for tensor subclasses, which inherit from torch.Tensor and
will want to super() call into it and will only notice later that
only float works as a dtype. So in this PR I relax the behavior
for this case to make the torch.Tensor constructor more useful for
subclasses.
Signed-off-by: Edward Z. Yang [email protected]
Differential Revision: D34707396