nn.Linear will accept input batches with the shape [batch_size, *, nb_features].
The standard use case would be just [batch_size, nb_features], where nb_features defines the number of features in each sample.
E.g. if your data only has a single feature, you should pass the input as [batch_size, 1].