pauloabelha:

If I reshape my tensor to use Torch’s current CrossEntropy, will autograd know automatically what to do to differentiate?


Yep. Basically, if do an operation on a Variable and PyTorch doesn’t complain when you do the operation, nor during .backward(), then it is a fairly safe bet that autograd was able to differentiate it properly.