Your out layer is of shape [4,64,6,6] so you should reshape first out not x and secondly, you should hence reshape by [-1,64 x 6 x 6]. see below
...
     self.fc1 = torch.nn.Linear(64*6*6, 1000) 
     self.fc2 = torch.nn.Linear(1000, 10)


    def forward(self, x):
        out = self.layer1(x) 
        out = self.layer2(out) 
        print(out.shape)
        out = out.view(-1, 64*6*6)
        print(out.shape)
        out = self.drop_out(out) 
        out = self.fc1(out) 
        out = self.fc2(out) 
        return out