Thank you Sai very much I was stuck on this for a long time one last thing can you suggest me any codes for the Evaluation part   .Can you help me with this?this is my code I am passing a
dataloader to test the accuracy of the model .This was my code for a simpler models where there was a single output
def evaluation(dataloader):
  total,correct=0,0
  for data in dataloader:
    inputs,labels=data
    inputs,labels=inputs.to(device),labels.to(device)
    out=net(inputs)
    _,pred=torch.max(out.data,1)
    total+=labels.size(0)
    correct+=(pred==labels).sum().item()
  return 100*correct/total

Should i apply the same transformations to the targets as above ?If possible provide code snippets.