The shape of the input is wrong:
Linear layers 831 take an input in the shape of:  (N, *, in_feautres). And yet you are passing an input with the shape of (N, in_features, *).  To fix this you can do:
input = input.view(-1, in_features)
Or:
input = input.unsqueeze_(2)
Best,
Diego