-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[proto] Clean-up Label.to_categories #6419
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
Conversation
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.
LGTM, thanks!
|
||
return apply_recursively(lambda idx: cast(Sequence[str], self.categories)[idx], self.tolist()) | ||
return tree_map(lambda idx: self.categories[idx], self.tolist()) |
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.
We have a lot of calls to apply_recursively
, should we update them all?
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.
but also, _pytree
looks private - should we actually use it ?
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, in transforms I already replaced almost all of them (remains only BatchMultiCrop)
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.
LGTM if CI is green.
Hey @vfdev-5! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
@vfdev-5 @pmeier @datumbox any thought on #6419 (comment) ? |
It is used in functorch eager ops (e.g. vmap: https://github.com/pytorch/functorch/blob/518fecce963846679add02ad36a65d36d59a362d/functorch/_src/vmap.py#L11), so I would expect to be able to use it |
I believe We probably want to be careful about using private stuff from core because it will not just break us on GitHub; most importantly, if a Meta engineer modifies that private API internally, they'll start seeing the torchvision tests fail for no good reason. Nobody wants to see their code fail just because someone else has been using a private API from their repo. |
functorch isn't the only library that uses We haven't exposed |
There's an issue already over at pytorch/pytorch#65761 |
@vfdev-5 Out of curiosity what was the original reason to go from |
Performance issue may be resolved from core side. From torchvision point of view keeping our own implementations (e.g. @NicolasHug we also using |
Summary: * [proto] Clean-up Label.to_categories * Fixed flake8 Reviewed By: datumbox Differential Revision: D38824230 fbshipit-source-id: 4bb30daccc927e7c515105a1b4b8ab9f341cad8b
No description provided.