What about pytorch 1.1.0 for cross entropy loss? My input is 3d: [#batch_size, #class_index, #scores] , while the target is 2d: [#batch_size, #class_index]. I’ve asked the question here, but couldn’t find a good solution yet: Cross entropy loss for sentence classification