PatricYan:

but there are many 0s in out when data.shape [128, 1, 27],


This shape wouldn’t make sense, since you are trying to classify a single class using a multi-class classification loss. The zeros coming from log_softmax indicate a 1. probability for this single class.