What is happening is that numpy is more lenient with regards to vector/matrix multiplication than pytorch.  So you need to make one or both of the tensors into 2 dimensional tensors rather than 1d.  You should look at the size of each tensor (x.size(), weights_input_hidden.size()), you’ll find one or both have just one dimension.  To add dummy dimensions use any (but not all!) of the following:
x = x.unsqueeze(0)
x.unsqueeze_(0)
x = x.view(1, -1).contiguous()