I cannot reproduce the issue and get a valid shape mismatch:
x = torch.randn(1, 1792)
lin = nn.Linear(128, 64)
out = lin(x)
> RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x1792 and 128x64)

lin.cuda()
out = lin(x.cuda())
> RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x1792 and 128x64)