Thanks ,that fixed the Long issue. I get another issue after that, the tensor sizes do not match.
ttargets.size() is
[torch.cuda.LongTensor of size 11 (GPU 0)]
and toutputs.size() is:
[torch.cuda.FloatTensor of size 11x13 (GPU 0)]
My question is how can I calculate accuracy generically for any tensor like how  " loss = criterion(outputs, targets)" can calculate the loss without knowing the details? I looked through the code for criterion (CrossEntropyLoss) and I am confused on how it is calculating loss.