def downsample_concatenate(X, kernel):
b, h, w, c = X.shape
Y = X.contiguous().view(b, h, w // kernel, c * kernel)
Y = Y.permute(0, 2, 1, 3).contiguous()
Y = Y.view(b, w // kernel, h // kernel, kernel * kernel * c).contiguous()
Y = Y.permute(0, 2, 1, 3).contiguous()
return Y
I don't understand why not directly cut the pictures into quarters, could you tell me what will happen if I just replace the above codes with the following? Thank you! :)
def downsample_concatenate(X, kernel):
b, h, w, c = X.shape
Y = X.contiguous().view(b, h//kernel, w // kernel, c * kernel*kernel)
return Y