-
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
Various doc fixes for transforms #3704
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.
Thanks for the PR @voldemortX !
torchvision/transforms/functional.py
Outdated
|
||
- constant: pads with a constant value, this value is specified with fill | ||
|
||
- edge: pads with the last value on the edge of the image, | ||
if input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2 | ||
- edge: pads with the last value at the edge of the image |
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.
With the propsoed changes the docs look like this:
Perhaps it would look slightly better like this:
Which requires the next line starting on the same column of the e
of edge
, i.e.:
- edge: pads with the last value at the edge of the image.
If input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2
- reflect: pads with reflection of image without repeating the last value on the edge.
For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
will result in [3, 2, 1, 2, 3, 4, 3, 2]
- symmetric: pads with reflection of image repeating the last value on the edge.
For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
will result in [2, 1, 1, 2, 3, 4, 4, 3]
(You'll need to add full dots at the end of the sentences otherwise it will not read well).
WDYT?
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.
@NicolasHug Yes I think your suggestion does look better (tighter but smoother), I'll commit again in a bit.
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.
Changed as requested 87c4885
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 @voldemortX !
On second thought, the |
It's the oldest trick in the book: introduce some subtle bugs so you can claim the fixes later 😆 |
Reviewed By: NicolasHug Differential Revision: D28169133 fbshipit-source-id: 3a6c789b88263f2ed01c6e5ffba6ad8a972d52de
padding_mode
bullet listsJust found these when building master docs yesterday, what do you think? @datumbox