Solved by chhaya_kumar_das in post #7 
              
              
                After few digging I have found a workaround that does not change the targets. The code snippet is given below. 
## Iterations
for i in range(20):
    print("Iter No:",i)
    for xtr,ytr in dataloader:
        #print("Iter No:",i)
        #optimizer.zero_grad()
        y_tr = [{k:v for k,v in t.items…