Solved by KFrank in post #4 
              
              
                Hi Samuel! 

Consider the following: 
>>> import torch
>>> torch.__version__
'1.9.0'
>>>
>>> # your scalar x = z[0] and y = z[1]
>>> z = torch.nn.Parameter (torch.tensor ([3.0, 7.0]))   # just to make it more interesting than 0.0
>>> equationCoefficients = torch.tensor ([[1.0, 1.0], [1.0, -1.0]])
>>>…