Thanks I just fixed it but now after one epoch I am getting an error “RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn”. Could you please tell what is the problem here now??? Thanks