I am following this tutorial https://pytorch.org/tutorials/beginner/nlp/deep_learning_tutorial.html#example-logistic-regression-bag-of-words-classifier 1
nn.Linear(vocab_size, num_labels)
means that the matrix shape is num_labels x vocab_size
bow_vector dimensions is 1 x vocab_size and input expected for nn.linear is batch_size x features
Now, we are multiplying num_labels x vocab_size matrix by 1 x vocab_size. Thus, the dimensions don’t match for matrix multiplication. What am I missing here?