I don’t know what the two dimensions in your input mean, but assuming they represent independent features, you could use:
x = x.view(x.size(0), -1)

to flatten the input into the shape [batch_size=8, features=15*50].
The in_features of the first linear layer would also be set to 15*50 in this case.
Note that nn.Linear layers accept multiple dimensions, where the last dim would correspond to the in_features while the other additional dimensions would be used to reapply the linear layer on them.
This could be used in case your dim1 dimension represent a temporal dimension and you would like to apply the model on all time steps in it.