first I used the PyTorch lighting module, with this it was working as same as mentioned in the issue. Then  I wrote my own trainer and in this, I used loss.item(). Do you think is there any mistake doing in model itself.