-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Add parameter type to to_tensor
#8251
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8251
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (33 Unrelated Failures)As of commit fbac810 with merge base 6a936e4 (): FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @adamtheturtle! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
torchvision/transforms/functional.py
Outdated
@@ -123,7 +123,7 @@ def _is_numpy_image(img: Any) -> bool: | |||
return img.ndim in {2, 3} | |||
|
|||
|
|||
def to_tensor(pic) -> Tensor: | |||
def to_tensor(pic: Image | np.ndarray) -> 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.
Thanks for the PR @adamtheturtle , I think you'll have to use Union
instead of |
as |
isn't supported in some older Python versions
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.
Thank you @NicolasHug . I have updated this PR.
cd92de4
to
a1cd97c
Compare
Thanks @adamtheturtle Looks like the tests are failing:
I'm going to make this a "draft" PR - when the failures are fixed please ping me again with @NicolasHug so I can take a look! thank you |
a1cd97c
to
033a72a
Compare
@NicolasHug I think we should be good now |
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.
Thank you @adamtheturtle
Thank you @NicolasHug for getting this in. |
Summary: Co-authored-by: Nicolas Hug <[email protected]> Reviewed By: vmoens Differential Revision: D55062810 fbshipit-source-id: 142052d28b3d5948876ebf63cc64fd3e2f28e37b
cc @vfdev-5