-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Pixel shuffle Layer #2833
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
Pixel shuffle Layer #2833
Conversation
Updated Cereal_nvp
Added pixel shuffle to more_types
|
@zoq @kartikdutt18 Are there any more changes required in this pr. |
kartikdutt18
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.
Hey @abh2k, These are minor changes and a point to discuss on. Thanks for taking the time to create the PR.
Regards.
| arma::mat inputImage = input.col(n); | ||
| arma::mat outputImage = output.col(n); | ||
| arma::cube inputTemp(const_cast<arma::mat&>(inputImage).memptr(), height, | ||
| width, size, false, false); | ||
| arma::cube outputTemp(const_cast<arma::mat&>(outputImage).memptr(), | ||
| outputHeight, outputWidth, sizeOut, false, false); |
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.
I'm not sure about this but maybe we can do this without the creating copies (which add to latency / space utilization). If
arma::cube inputTemp(const_cast<arma::mat&>(input.col(n)).memptr(), height,
width, size, false, false);
doesn't work, we can
arma::cube inputTemp(const_cast<arma::mat&>(input).memptr(), height,
width, size * batchSize, false, false);
and then use span. That way we don't create copies.
Also save time on copying back (maybe). Let me know incase I missed something.
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.
@kartikdutt18 @zoq I made the required changes. Now the copying step has been removed. Please review.
Co-authored-by: kartikdutt18 <[email protected]>
075881a to
7b70a82
Compare
kartikdutt18
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 to me!
Thanks a lot for the contribution.
Regards.
| @@ -0,0 +1,180 @@ | |||
| /** | |||
| * @file methods/ann/layer/pixel_shuffle.hpp | |||
| * @author Anjishnu Mukherjee | |||
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.
Feel free to add yourself as co-author.
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.
Second approval provided automatically after 24 hours. 👍
birm
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.
Thanks for following up on #2563 :)
Added pixel shuffle layer