-
Notifications
You must be signed in to change notification settings - Fork 26.3k
added pixel shuffle layer + tests #338
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
Conversation
apaszke
left a comment
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.
Looks good, but please save the output for backward and don't keep the grad buffer around.
torch/nn/modules/pixelshuffle.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/nn/modules/pixelshuffle.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/nn/modules/pixelshuffle.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/nn/modules/pixelshuffle.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/nn/modules/pixelshuffle.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@apaszke have addressed the comments above |
apaszke
left a comment
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 misread the code last time 😕
torch/nn/functions/pixelshuffle.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
test/test_nn.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@apaszke done. |
apaszke
left a comment
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.
Last minor thing
torch/nn/functions/pixelshuffle.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
removed duplicate save_for_backward
|
@apaszke all done |
|
Thanks! |
|
Is it possible to generalize it to 5D tensors (B, C, D, W, H)? |
* 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>
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.).