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] + 4*x[1]**3
y = torch.stack([y1, y2])

y.backward(torch.ones_like(y))

print(x.grad) #returns tensor([ 7., 49.])