I can find just a docstring when I go to torch.nn.functional.pixel_shuffle
. Where can I find the actual implementation?
from .module import Module
from .. import functional as F
from torch import Tensor
class PixelShuffle(Module):
r"""Rearranges elements in a tensor of shape :math:`(*, C \times r^2, H, W)`
to a tensor of shape :math:`(*, C, H \times r, W \times r)`, where r is an upscale factor.
This is useful for implementing efficient sub-pixel convolution
with a stride of :math:`1/r`.
See the paper:
`Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network`_
by Shi et. al (2016) for more details.
Args:
upscale_factor (int): factor to increase spatial resolution by
This file has been truncated. show original
ptrblck
January 21, 2022, 7:53pm
#2
The implementation can be found here .
@ptrblck Thanks a bunch!!
Hey,
I cannot find the cpp file in the installed packages anywhere. I want to change the implementation locally. Where can I do that?
ptrblck
January 25, 2022, 7:32am
#5
You won’t be able to locally change a C++ source file and see the changes without rebuilding it.
To apply changes to the PixelShuffle
implementation, use this guide to build PyTorch from source, manipulate the file, and rebuild it.
This Contributing README might also be useful for incremental builds.
1 Like
Thanks a lot for helping out. Really appreciate the effort.