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
Now, for better understanding:
open im2col.py and add the code below at the bottom. Then run python im2col.py and observe the output:
init = Variable(torch.randn((1, 3, 4, 4)).cuda())
z = 0
for i in range(init.size(1)):
for j in range(init.size(2)):
for k in range(init.size(3)):
init[0, i, j, k] = z + 1
z+=1
unrolled = im2col_batch(init, 2, 1, 0)
print(init.size())
print(unrolled.size())
unr_reshape = torch.reshape(unrolled, (1, unrolled.size(1)*unrolled.size(2)*unrolled.size(3), unrolled.size(4)*unrolled.size(5)))
print(unr_reshape)
You should be able to replicate the blog image with this code. I hope this helps in understanding how to manipulate the dimensions!
Can you provide some sample codes? No idea about how to manipulate 5 dims (or 6 dims).
The text was updated successfully, but these errors were encountered: