-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[jit] improve error message on inferred type #21058
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
Closed
Closed
Conversation
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
Previously we would give confusing error messages when we inferred an unannotated type to be Tensor. This adds a hint to the compiler diagnostic so that users might be less confused.
[jit] improve error message on inferred type Previously we would give confusing error messages when we inferred an unannotated type to be Tensor. This adds a hint to the compiler diagnostic so that users might be less confused. This PR moves the type inference logic from the frontend to compiler.cpp. So now the `Param` tree view's type is optional, and we track whether or not we inferred the type of a schema argument to be Tensor. We use that info to format a proper error message. Also this dedupes some of the error messages reporting since we were replicating similar strings in several places. gh-metadata: pytorch pytorch 21058 gh/suo/42/head
[jit] improve error message on inferred type Previously we would give confusing error messages when we inferred an unannotated type to be Tensor. This adds a hint to the compiler diagnostic so that users might be less confused. This PR moves the type inference logic from the frontend to compiler.cpp. So now the `Param` tree view's type is optional, and we track whether or not we inferred the type of a schema argument to be Tensor. We use that info to format a proper error message. Also this dedupes some of the error messages reporting since we were replicating similar strings in several places. gh-metadata: pytorch pytorch 21058 gh/suo/42/head
zdevito
approved these changes
May 29, 2019
Contributor
zdevito
left a comment
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.
Looks good!
[jit] improve error message on inferred type Previously we would give confusing error messages when we inferred an unannotated type to be Tensor. This adds a hint to the compiler diagnostic so that users might be less confused. This PR moves the type inference logic from the frontend to compiler.cpp. So now the `Param` tree view's type is optional, and we track whether or not we inferred the type of a schema argument to be Tensor. We use that info to format a proper error message. Also this dedupes some of the error messages reporting since we were replicating similar strings in several places. gh-metadata: pytorch pytorch 21058 gh/suo/42/head
[jit] improve error message on inferred type Previously we would give confusing error messages when we inferred an unannotated type to be Tensor. This adds a hint to the compiler diagnostic so that users might be less confused. This PR moves the type inference logic from the frontend to compiler.cpp. So now the `Param` tree view's type is optional, and we track whether or not we inferred the type of a schema argument to be Tensor. We use that info to format a proper error message. Also this dedupes some of the error messages reporting since we were replicating similar strings in several places. gh-metadata: pytorch pytorch 21058 gh/suo/42/head
Contributor
[jit] improve error message on inferred type Previously we would give confusing error messages when we inferred an unannotated type to be Tensor. This adds a hint to the compiler diagnostic so that users might be less confused. This PR moves the type inference logic from the frontend to compiler.cpp. So now the `Param` tree view's type is optional, and we track whether or not we inferred the type of a schema argument to be Tensor. We use that info to format a proper error message. Also this dedupes some of the error messages reporting since we were replicating similar strings in several places. gh-metadata: pytorch pytorch 21058 gh/suo/42/head
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
May 30, 2019
Summary: Pull Request resolved: pytorch/pytorch#21058 ghimport-source-id: 7fad3a0567022dd417f4bd079a50a22e3c1dc020 Differential Revision: D15547218 Pulled By: suo fbshipit-source-id: 5dbd567c79e6d01e9af4b8552777f7f0043df5b2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Merged
module: cpp
Related to C++ API
module: custom-operators
custom operators, custom ops, custom-operators, custom-ops
module: internals
Related to internal abstractions in c10 and ATen
module: pybind
Related to our Python bindings / interactions with other Python libraries
module: tests
Issues related to tests (not the torch.testing module)
oncall: jit
Add this issue/PR to JIT oncall triage queue
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:
Previously we would give confusing error messages when we inferred an
unannotated type to be Tensor. This adds a hint to the compiler
diagnostic so that users might be less confused.
This PR moves the type inference logic from the frontend to
compiler.cpp. So now the
Paramtree view's type is optional, and wetrack whether or not we inferred the type of a schema argument to be
Tensor. We use that info to format a proper error message.
Also this dedupes some of the error messages reporting since we were
replicating similar strings in several places.
gh-metadata: pytorch pytorch 21058 gh/suo/42/head
Differential Revision: D15547218