Skip to content
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

Merged
merged 5 commits into from
Apr 21, 2021

Conversation

voldemortX
Copy link
Contributor

@voldemortX voldemortX commented Apr 21, 2021

  1. ``` to ``
  2. Correct and unify all padding_mode bullet lists

Just found these when building master docs yesterday, what do you think? @datumbox

Copy link
Member

@NicolasHug NicolasHug left a 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 !


- 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
Copy link
Member

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:

image


Perhaps it would look slightly better like this:

image

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed as requested 87c4885

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @voldemortX !

@NicolasHug NicolasHug changed the title [RFC] Some small transforms documentation fix Various doc fixes for transforms Apr 21, 2021
@NicolasHug NicolasHug merged commit 2f3b7ca into pytorch:master Apr 21, 2021
@voldemortX
Copy link
Contributor Author

voldemortX commented Apr 21, 2021

On second thought, the padding_mode doc bug was probably introduced by myself #3200 or something. I should've fixed this last year...

@NicolasHug
Copy link
Member

NicolasHug commented Apr 21, 2021

It's the oldest trick in the book: introduce some subtle bugs so you can claim the fixes later 😆

facebook-github-bot pushed a commit that referenced this pull request May 4, 2021
Reviewed By: NicolasHug

Differential Revision: D28169133

fbshipit-source-id: 3a6c789b88263f2ed01c6e5ffba6ad8a972d52de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants