8000 [Set] Raise `TypeError` if argument is unhashable by guilhermeleobas · Pull Request #152988 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[Set] Raise TypeError if argument is unhashable #152988

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

Conversation

[ghstack-poisoned]
Copy link
pytorch-bot bot commented May 6, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/152988

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 3da5a81 with merge base 064f4c1 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
@@ -127,7 +137,7 @@ def __init__(self, vt) -> None:
# TODO Temorarily remove to figure out what keys are we breaking on
# and add proper support for them
if not is_hashable(vt):
unimplemented(f"Dict key of type {type(vt)}. Key: {vt}")
raise_unhashable(vt)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It makes more sense to keep the code as it is (raise unimplemented). But this gives a chance for Dynamo to capture and handle an exception when one tries to add an unhashable object to a set. If Dynamo doesn't capture, the exception is propagated to CPython.

@guilhermeleobas guilhermeleobas marked this pull request as ready for review May 7, 2025 14:24
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@guilhermeleobas guilhermeleobas requested a review from StrongerXi May 8, 2025 18:37
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #152990

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Update
8000
[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #152990

1 similar comment
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #152990

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #152908

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #152990

pytorchmergebot pushed a commit that referenced this pull request May 16, 2025
pytorchmergebot pushed a commit that referenced this pull request May 16, 2025
pytorchmergebot pushed a commit that referenced this pull request May 16, 2025
pytorchmergebot pushed a commit that referenced this pull request May 16, 2025
pytorchmergebot pushed a commit that referenced this pull request May 16, 2025
pytorchmergebot pushed a commit that referenced this pull request May 16, 2025
pytorchmergebot pushed a commit that referenced this pull request May 16, 2025
pytorchmergebot pushed a commit that referenced this pull request May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0