If you are referring to line17, then yes, this is the standard way to calculate the loss:
loss = criterion(outputs_tr, labels_tr)




 bioinfo-dirty-jobs:

It is correct calculate the ACC after training in this way?


The script does neither import not define the metric functions (mcor, acc, precision, recall), so we cannot answer, if the implementation is correct.