-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[jit] Fix flipped PackedSequence outputs in script #32955
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
@@ -61,37 +61,6 @@ class PackedSequence(PackedSequence_): | |||
# | |||
# See the note above in doc string (starting with ":attr:`data` can be on | |||
# arbitrary device..."). | |||
|
|||
def __new__(cls, data, batch_sizes=None, sorted_indices=None, unsorted_indices=None): |
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.
I see that you have edited construction of PackedSequence within our library, but doesn't removing this break BC for any user code that uses this API?
Summary: Stacked PRs * #32955 - [jit] Fix flipped PackedSequence outputs in script * **#32953 - [jit] Support properties on `Device`** PyTorch devices have a `index` and `type` property. This PR adds support for both to TorchScript ](https://our.intern.facebook.com/intern/diff/19849320/) Pull Request resolved: #32953 Pulled By: driazati Differential Revision: D19849320 fbshipit-source-id: ce845258c6110058dd9ea1f759ef74b7ed2e786e
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.
I guess this is a fine short-term fix. But ignoring __new__
style constructors means that this a silently-wrong semantics issue (& why we've had all these confusing LSTM bugs). When classes have __new__
constructors we error. Can you file an issue for this ?
cc @jamesr66a
@@ -108,6 +108,19 @@ std::shared_ptr<SugaredValue> SimpleValue::attr( | |||
} | |||
} | |||
|
|||
if (value_->type()->isSubtypeOf(DeviceObjType::get())) { |
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.
I think this is no longer meant to be here
Test failures on master look relevant:
will unland. |
Summary: Stacked PRs * **#32955 - [jit] Fix flipped PackedSequence outputs in script** * #32953 - [jit] Support properties on `Device` Fixes #32605 ](https://our.intern.facebook.com/intern/diff/20103905/) Pull Request resolved: #32955 Pulled By: driazati Differential Revision: D20103905 fbshipit-source-id: 84081213ed214846e563b9f05bcab0210bb1a71b
Summary: Stacked PRs * pytorch#32955 - [jit] Fix flipped PackedSequence outputs in script * **pytorch#32953 - [jit] Support properties on `Device`** PyTorch devices have a `index` and `type` property. This PR adds support for both to TorchScript ](https://our.intern.facebook.com/intern/diff/19849320/) Pull Request resolved: pytorch#32953 Pulled By: driazati Differential Revision: D19849320 fbshipit-source-id: ce845258c6110058dd9ea1f759ef74b7ed2e786e
Summary: Stacked PRs * **pytorch#32955 - [jit] Fix flipped PackedSequence outputs in script** * pytorch#32953 - [jit] Support properties on `Device` Fixes pytorch#32605 ](https://our.intern.facebook.com/intern/diff/20103905/) Pull Request resolved: pytorch#32955 Pulled By: driazati Differential Revision: D20103905 fbshipit-source-id: 84081213ed214846e563b9f05bcab0210bb1a71b
Summary: Stacked PRs * **pytorch#32955 - [jit] Fix flipped PackedSequence outputs in script** * pytorch#32953 - [jit] Support properties on `Device` Fixes pytorch#32605 Pull Request resolved: pytorch#32955 Pulled By: driazati Differential Revision: D20165514 fbshipit-source-id: a130c438b40e51ec27d36f021b0dc7869570aa6a
Stacked PRs
Device
#32953 - [jit] Support properties onDevice
Fixes #32605
Differential Revision: D20165514