Solved by InnovArul in post #2 
              
              
                Remember that cross entropy loss = ‘log softmax’ + ‘negative log likelihood’. 
Hence,  you may need to set 
prediction[1,1]=float("-inf")