Every Conv2D layers majorly takes 3 parameters as input in the respective order: (in_channels, out_channels, kernel_size), where the out_channels acts as the in_channels for the next layer.
As rightly mentioned, you’ve defined 64 out_channels, whereas in pytorch implementation you are using 32*64 channels as output (which should not be the case).
Before using Dense Layer (Linear Layer in case of pytorch), you have to flatten the output and feed the flatten input in the Linear layer. Suppose if x is the input to be fed in the Linear Layer, you have to reshape it in the pytorch implementation as:
x  =  x.view(batch_size, -1),
where batch_size is the number of images being loaded using the ImageLoader function of torch.