You are trying to reshape your fc1 output of size 2312 to (1, 1156, 1156) which is 1156*1156=1336336.
You could try to change the linear output to self.fc1 = nn.Linear(2312, 1024) and corresponding to this in the forward pass out = out.view(out.size(0), 1, 32, 32).