You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the reshaping is not just one line because vertical neighboring pixels are not next to each other in memory. So for example for a 2x2 concatenation, we first concatenate the channels of the horizontal neighbors. Then permute the dimensions and concatenate the vertical neighbors that are contiguous in memory. I was a bit crazy with the .contiguous(), some are maybe not necessary but they would lead to a no op so should not be a problem ;)
I am curious if you have a better/simpler solution that passes a test to match the output of my function.
Any explanation as to why this function is so involved? It's simply copying the input tensor and reshaping it. Why do we need four steps to do this?
attention-cnn/models/transformer.py
Line 145 in 21483bb
The text was updated successfully, but these errors were encountered: