-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Use functools.cached_property #40607
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
Use functools.cached_property #40607
Conversation
df26061
to
487fefe
Compare
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.
Yes, this seems like a good PR! We can also remove the cached_property
decorator from utils.generic
entirely, since it's built-in after 3.8 and our minimum version is Py 3.9. Made one comment but otherwise we should be good to go.
I am afraid of breaking others code because they may import it. |
860ed3a
to
9552693
Compare
@cyyever yeah, good instincts on not wanting to break remote code models! I think it's okay, though - because |
@Rocketknight1 Ok, let's remove it. |
Signed-off-by: cyy <cyyever@outlook.com>
b280676
to
d897c9d
Compare
Signed-off-by: cyy <cyyever@outlook.com>
d897c9d
to
46ac768
Compare
@Rocketknight1 Ping |
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.
Yep, looks good to me now!
Head branch was pushed to by a user without write access
@Rocketknight1 It is removed from doc, otherwise doc can't build. |
ef9f620
to
8bd1ceb
Compare
8bd1ceb
to
cf521fe
Compare
[For maintainers] Suggested jobs to run (before merge) run-slow: audio_spectrogram_transformer, bark, bart, beit, bert_generation, big_bird, bit, blenderbot, blenderbot_small, bridgetower, byt5, canine, codegen, conditional_detr, convnext, convnextv2 |
LGTM now! |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
* cached_property is avaiable in functools Signed-off-by: cyy <cyyever@outlook.com> * Remove cached_property Signed-off-by: cyy <cyyever@outlook.com> * Fix docs Signed-off-by: Yuanyuan Chen <cyyever@outlook.com> --------- Signed-off-by: cyy <cyyever@outlook.com> Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
* cached_property is avaiable in functools Signed-off-by: cyy <cyyever@outlook.com> * Remove cached_property Signed-off-by: cyy <cyyever@outlook.com> * Fix docs Signed-off-by: Yuanyuan Chen <cyyever@outlook.com> --------- Signed-off-by: cyy <cyyever@outlook.com> Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
What does this PR do?
Use
functools.cached_property
rather than the shipped one.