Solved by AlphaBetaGamma96 in post #2 
              
              
                Hey, 
I have a feeling this issue arises with y = torch.tensor([y1, y2]), as it takes 2 floats and puts them within a Tensor. I quickly ran your code but with torch.stack and the gradients are computed! 
import torch 

x = torch.tensor([1., 2.], requires_grad=True)

y1 = 2*x[0]**2 + x[1]
y2 = 3*x[0]…