pytorch-vq-vae icon indicating copy to clipboard operation
pytorch-vq-vae copied to clipboard

Hi, why do we need to swap axis before we flatten?

Open diff7 opened this issue 4 years ago • 0 comments

Hi, I can't figure out why we need to change from BCHW to BHWC before we flatten. I would be happy if you could explain this moment. Thank you!

convert inputs from BCHW -> BHWC

    inputs = inputs.permute(0, 2, 3, 1).contiguous()
    input_shape = inputs.shape
    
    # Flatten input
    flat_input = inputs.view(-1, self._embedding_dim)

diff7 avatar Jun 14 '20 13:06 diff7