Skip to content

[jit] improve constants error message#13072

Closed
driazati wants to merge 2 commits intopytorch:masterfrom
driazati:cerr
Closed

[jit] improve constants error message#13072
driazati wants to merge 2 commits intopytorch:masterfrom
driazati:cerr

Conversation

@driazati
Copy link
Copy Markdown
Contributor

Adds the attribute name to the error message and fixes the corresponding
test to actually run

Adds the attribute name to the error message and fixes the corresponding
test to actually run
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Comment thread test/test_jit.py
with tester.assertRaisesRegex(TypeError, "not a valid constant"):
self.i = (3, 4, {})

f = Foo()

This comment was marked as off-topic.

This comment was marked as off-topic.

facebook-github-bot pushed a commit that referenced this pull request Oct 30, 2018
Summary:
Depends on #13072

Adds support for tuples as variables instead of just as literals. Before, tuples would give the error `python value of type 'tuple' cannot be used as a value`. This PR adds a flag on `SugaredValue` to determine in a value is a tuple or not.
Pull Request resolved: #13086

Differential Revision: D10846632

Pulled By: driazati

fbshipit-source-id: 7b5d6ae9426ca3dd476fee3f929357d7b180faa7
@ezyang ezyang added the merged label Jun 25, 2019
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Adds the attribute name to the error message and fixes the corresponding
test to actually run
Pull Request resolved: pytorch#13072

Differential Revision: D10846622

Pulled By: driazati

fbshipit-source-id: a7eee6320c28140c4937ede3d4e4685cfce08d84
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Depends on pytorch#13072

Adds support for tuples as variables instead of just as literals. Before, tuples would give the error `python value of type 'tuple' cannot be used as a value`. This PR adds a flag on `SugaredValue` to determine in a value is a tuple or not.
Pull Request resolved: pytorch#13086

Differential Revision: D10846632

Pulled By: driazati

fbshipit-source-id: 7b5d6ae9426ca3dd476fee3f929357d7b180faa7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants