-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Remove wrap_like class method and add datapoints.wrap() function #7832
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.
Few minor comments. Otherwise, LGTM. Thanks Nicolas!
@@ -12,3 +12,25 @@ | |||
import warnings | |||
|
|||
warnings.warn(_BETA_TRANSFORMS_WARNING) | |||
|
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.
Not going to block over this, but I would prefer keeping logic out of __init__.py
.
@@ -12,3 +12,25 @@ | |||
import warnings | |||
|
|||
warnings.warn(_BETA_TRANSFORMS_WARNING) | |||
|
|||
|
|||
def wrap(wrappee, *, like, **kwargs): |
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.
def wrap(wrappee, *, like, **kwargs): | |
D = TypeVar("D", bounds=Datapoint) | |
def wrap(wrappee: torch.Tensor, *, like: D, **kwargs: Any) -> D: |
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.
🤮
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 had merged the suggestion and fixed the imports but it created more problems in the BBox._wrap, so I'm getting rid of it. Mypy is green anyway.
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'll have a look.
Co-authored-by: Philip Meier <github.pmeier@posteo.de>
Hey @NicolasHug! 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 |
…tion (#7832) Summary: Co-authored-by: Philip Meier <github.pmeier@posteo.de> Reviewed By: matteobettini Differential Revision: D48642267 fbshipit-source-id: 43331507612c8980dd275aaaa40d38801a3c95c9
cc @vfdev-5