-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Simplified usage log API #5095
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
Simplified usage log API #5095
Conversation
💊 CI failures summary and remediationsAs of commit 5458cde (more details on the Dr. CI page):
1 failure not recognized by patterns:
This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
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.
@@ -88,6 +89,7 @@ def norm_range(t, value_range): | |||
else: | |||
norm_range(tensor, value_range) | |||
|
|||
assert isinstance(tensor, torch.Tensor) |
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.
Type check complaints about
Item "List[Tensor]" of "Union[Tensor, List[Tensor]]" has no attribute "size"
Since list of tensors should have been stacked together on line 57, I think this is a fair assertion.
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.
Nope, this works as expected:
Lines 54 to 56 in f5dca44
# if list of tensors, convert to a 4D mini-batch Tensor | |
if isinstance(tensor, list): | |
tensor = torch.stack(tensor, dim=0) |
I look into it an see why mypy
doesn't pick up on this.
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.
Sorry I looked it quickly and missed this. Sounds good.
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.
Keeping this open for now. I'm fine with the fix for this PR, but something weird is going on. I can reproduce the issue, but this PR shouldn't do anything to trigger it. I'll investigate more thoroughly.
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.
@pmeier just to clarify, should I remove this assertion and ignore the type check error for now? since you'll investigate more thoroughly
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.
Keep it in for now. I'll try to figure out how to make mypy
happy without the assert
in.
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.
Thanks a lot for the work @kazhang. I think this looks much better.
@NicolasHug could you also have a quick look just to be sure?
@vfdev-5 Does it make sense to add log calls to the _interpolate_bilinear2d_aa
and _interpolate_bicubic2d_aa
methods on a separate PR?
FYI @pmeier We are getting some failures on the dataset failures on the prototype.
@datumbox I think we can skip logging these methods (_interpolate_bilinear2d_aa, _interpolate_bicubic2d_aa) |
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.
Thanks @kazhang , one nit (feel free not to address it) but LGTM anyway!
Hey @kazhang! 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 |
Summary: * log API v3 * make torchscript happy * make torchscript happy * add missing logs to constructor * log ops C++ API as well * fix type hint * check function with isinstance Reviewed By: prabhat00155 Differential Revision: D33253475 fbshipit-source-id: 32a2d61d1c993cf9456905437d1d7cb3bd467e04 Co-authored-by: Vasilis Vryniotis <[email protected]>
As we discussed in #5052, we want to: