-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[list] Implement list.count #153969
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
[list] Implement list.count #153969
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/153969
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a4b9391 with merge base 524e827 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
torch/_dynamo/polyfills/__init__.py
Outdated
| def count(iterator, value): | ||
| return sum(it is value or it == value for it in iterator) |
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.
Move this to polyfills.operator as operator.countOf.
a.py
Outdated
| @@ -1,34 +0,0 @@ | |||
| # import torch | |||
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.
Uh, what is this file lol
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.
This shouldn't be here 😅
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.
Oh, wait. Did I commit this file in a previous PR? lol
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.
Seems like it haha
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.
Oh man 🤦
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.
it looks like this file doesn't exist in main or viable/strict.
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.
I don't know how to actually fix this. a.py is not showing up on other branches or on main but it being tracked in this PR.
edit: git blame show the file was added in #150790 but it is not there as well
Oh: mistery solved! Found where the file came from.
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.
Seems reasonable. The operator.countOf feedback seems reasonable too as long as it works
|
Rebased |
|
Starting merge as part of PR stack under #156339 |
|
Rebased |
|
Starting merge as part of PR stack under #156339 |
|
Rebased |
|
Starting merge as part of PR stack under #156339 |
1 similar comment
|
Starting merge as part of PR stack under #156339 |
Pull Request resolved: #156148 Approved by: https://github.com/zou3519 ghstack dependencies: #153969
Pull Request resolved: #156242 Approved by: https://github.com/Skylion007, https://github.com/zou3519 ghstack dependencies: #153969, #156148
Pull Request resolved: #156270 Approved by: https://github.com/Skylion007, https://github.com/zou3519 ghstack dependencies: #153969, #156148, #156242
Stack from ghstack (oldest at bottom):
list.remove#156242cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames