Solved by KFrank in post #2 
              
              
                Hi Fabian! 

I don’t understand what you are saying here. 

The following example script may answer part of your question: 
import torch
torch.__version__

def  f (x, y):
    return x * y

x = torch.Tensor ([2.0])
x.requires_grad = True
y = torch.Tensor ([3.0])
y.requires_grad = True
u = f (x, y)
gr…