Thanks @ra_schoonhoven I found the solution. basically I was passing (input,labels,embedding) as IntTensor instead of LongTensor but when I passed (input,labels,embedding) as LongTensor it worked for me