Hi Tom,
thanks for your response. I would like to try autograd, but I don’t know where to put it. Currently I put it after training my NN like that:
model.eval()
with torch.no_grad():
    Predict = model(XTest)
    Function = model(X)

XGrad = Variable(X, requires_grad=True)
FGrad= Variable(Function, requires_grad=True)
Grad = torch.autograd.grad(outputs=FGrad, inputs=X,
                           grad_outputs=torch.ones_like(FGrad), allow_unused=True)

But, if I print Grad, it is basically (None,).
Could you be a little more precise please how to implement it :)?