As given in the new error message, you are trying to specify dim=1
while input
has only a single dimension.
Use dim=0
instead and make sure that’s really the expected shape.
Common use cases use at least two dimensions as [batch_size, feature_dim]
and use then the log_softmax
in the feature dimension, but I’m also not familiar with your use case so input
having a single dimension might be alright.