[JIT] add type refinements for isinstance checks#27772
Closed
zdevito wants to merge 3 commits intogh/zdevito/124/basefrom
Closed
[JIT] add type refinements for isinstance checks#27772zdevito wants to merge 3 commits intogh/zdevito/124/basefrom
zdevito wants to merge 3 commits intogh/zdevito/124/basefrom
Conversation
This was referenced Oct 11, 2019
[JIT] add type refinements for isinstance checks This replaces unchecked_unwrap_optional with unchecked_cast. This enables the generalization of type refinement so that it works for isinstance checks as well. This also removes unchecked_unwrap_optional from code we generate, which is good because it is a hard op to serialize well since it doesn't directly encode the Optional[T] being unwrapped. In contrast, unchecked_cast always explicitly lists the type. gh-metadata: pytorch pytorch 27772 gh/zdevito/124/head
[JIT] add type refinements for isinstance checks This replaces unchecked_unwrap_optional with unchecked_cast. This enables the generalization of type refinement so that it works for isinstance checks as well. This also removes unchecked_unwrap_optional from code we generate, which is good because it is a hard op to serialize well since it doesn't directly encode the Optional[T] being unwrapped. In contrast, unchecked_cast always explicitly lists the type. gh-metadata: pytorch pytorch 27772 gh/zdevito/124/head
[JIT] add type refinements for isinstance checks This replaces unchecked_unwrap_optional with unchecked_cast. This enables the generalization of type refinement so that it works for isinstance checks as well. This also removes unchecked_unwrap_optional from code we generate, which is good because it is a hard op to serialize well since it doesn't directly encode the Optional[T] being unwrapped. In contrast, unchecked_cast always explicitly lists the type. gh-metadata: pytorch pytorch 27772 gh/zdevito/124/head
jamesr66a
approved these changes
Oct 15, 2019
Collaborator
jamesr66a
left a comment
There was a problem hiding this comment.
don't blow anything up
Contributor
zdevito
added a commit
to zdevito/ATen
that referenced
this pull request
Oct 16, 2019
Summary: Pull Request resolved: pytorch/pytorch#27772 This replaces unchecked_unwrap_optional with unchecked_cast. This enables the generalization of type refinement so that it works for isinstance checks as well. This also removes unchecked_unwrap_optional from code we generate, which is good because it is a hard op to serialize well since it doesn't directly encode the Optional[T] being unwrapped. In contrast, unchecked_cast always explicitly lists the type. Test Plan: Imported from OSS Differential Revision: D17885424 Pulled By: zdevito fbshipit-source-id: ce81077d6fbeaf2a802a2e0b17349aca85670466
thiagocrepaldi
pushed a commit
to thiagocrepaldi/pytorch
that referenced
this pull request
Feb 4, 2020
Summary: Pull Request resolved: pytorch#27772 This replaces unchecked_unwrap_optional with unchecked_cast. This enables the generalization of type refinement so that it works for isinstance checks as well. This also removes unchecked_unwrap_optional from code we generate, which is good because it is a hard op to serialize well since it doesn't directly encode the Optional[T] being unwrapped. In contrast, unchecked_cast always explicitly lists the type. Test Plan: Imported from OSS Differential Revision: D17885424 Pulled By: zdevito fbshipit-source-id: ce81077d6fbeaf2a802a2e0b17349aca85670466
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
This replaces unchecked_unwrap_optional with unchecked_cast. This
enables the generalization of type refinement so that it works for
isinstance checks as well. This also removes unchecked_unwrap_optional from
code we generate, which is good because it is a hard op to serialize well
since it doesn't directly encode the Optional[T] being unwrapped. In contrast,
unchecked_cast always explicitly lists the type.
Differential Revision: D17885424