thanks for replying
I  removed log_softmax and used CrossEntropyLoss but I got this Error
Assertion `cur_target >= 0 && cur_target < n_classes' failed.  at /pytorch/aten/src/THNN/generic/ClassNLLCriterion.c:92