Skip to content

Conversation

@suo
Copy link
Member

@suo suo commented May 29, 2019

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 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

Differential Revision: D15547218

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.
@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue 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) labels May 29, 2019
[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
@suo suo requested review from eellison, jamesr66a and zdevito May 29, 2019 07:15
[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
Copy link
Contributor

@zdevito zdevito left a 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
@pytorchbot pytorchbot added the module: cpp Related to C++ API label May 29, 2019
@zou3519 zou3519 deleted the gh/suo/42/head branch May 29, 2019 21:49
[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
@suo suo reopened this May 29, 2019
@pytorchbot pytorchbot added the module: custom-operators custom operators, custom ops, custom-operators, custom-ops label May 29, 2019
@facebook-github-bot
Copy link
Contributor

@suo merged this pull request in 5dacf6b.

@suo suo reopened this May 29, 2019
[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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants