Hi, albanD, Could I ask a question please? Based on the FrancoisFleuret’s example, I defined  gradients = torch.FloatTensor([0.1]), and f3 = grad(f2, x, gradients, create_graph = True)[0], then the output is 0.6.
but, shouldn’t it is 6? the derivative of f2 w.r.t. x is the constant 6, no matter what the value of x is. Could you give me some instruction please?