Hi
I have been trying to undertand autograd operation given in different forms from several repos while i investigate a specific topic:
u = net(x,t) 
u_t = torch.autograd.grad(u.sum(), t, create_graph=True)[0]

and,
u = net(x,t) 
u_t = torch.autograd.grad(u, t,  grad_outputs=torch.ones_like(u), create_graph=True)[0]

and,
u = net(x,t) 
u_t = torch.autograd.grad(u.sum(), t,  grad_outputs=torch.ones_like(u), create_graph=True)[0]

Unfortunately it is not clear for me. I have two questions about this:

What are the main differences between them?
What is the correct way of calculating the gradients?
Thank you