Skip to content

Conversation

@alykhantejani
Copy link
Contributor

@alykhantejani alykhantejani commented Dec 21, 2016

Added the PixelShuffle layer which rearranges elements in a tensor of shape [B, C*r, H, W] to a tensor of shape [B, C, H*r, W*r].

This is useful for implementing efficient sub-pixel convolution with a stride of 1/r, which can be used for tasks such as super-resolution (see "Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network" - Shi et al.).

Copy link
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

Looks good, but please save the output for backward and don't keep the grad buffer around.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@alykhantejani
Copy link
Contributor Author

@apaszke have addressed the comments above

Copy link
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

Sorry, I misread the code last time 😕

This comment was marked as off-topic.

This comment was marked as off-topic.

test/test_nn.py Outdated

This comment was marked as off-topic.

This comment was marked as off-topic.

@alykhantejani
Copy link
Contributor Author

@apaszke done.

Copy link
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

Last minor thing

This comment was marked as off-topic.

This comment was marked as off-topic.

removed duplicate save_for_backward
@alykhantejani
Copy link
Contributor Author

@apaszke all done

@apaszke apaszke merged commit f7bd3f7 into pytorch:master Dec 22, 2016
@apaszke
Copy link
Contributor

apaszke commented Dec 22, 2016

Thanks!

@alykhantejani alykhantejani deleted the add_pixel_shuffle branch December 27, 2016 03:29
@danieltudosiu
Copy link

Is it possible to generalize it to 5D tensors (B, C, D, W, H)?

jjsjann123 pushed a commit to jjsjann123/pytorch that referenced this pull request Sep 23, 2020
KsenijaS pushed a commit to KsenijaS/pytorch that referenced this pull request Dec 14, 2020
* Update README.md

* Add model

* Added tar file

* Add README.md

* Add inference notebook

* Update README.md

* Update README.md table

* Update README.md

* Update README.md

* Fix inference notebook

* Update onnx model

* Update tar file

* Update README.md

* Update README.md

* update name

* Update tar file

* Ad base model

* Add tar file

* Add benchmark result

* Update README.mds

* Update model name

* Update accuracy score

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update text/machine_comprehension/roberta/README.md

* Update text/machine_comprehension/roberta/README.md

* Remove benchmark results file

* Update text/machine_comprehension/roberta/README.md

* Update text/machine_comprehension/roberta/README.md

Co-authored-by: Vinitra Swamy <vinitras@gmail.com>
KyleCZH pushed a commit to KyleCZH/pytorch that referenced this pull request Sep 20, 2021
eellison pushed a commit to eellison/pytorch that referenced this pull request Jun 29, 2022
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.

5 participants