That error comes from x[1]^ 2, in python ** is the exponentiation operator and ^ is the bitwise XOR. It seems that pytorch understandably does not support the bitwise XOR operation.
I see another error in your code. By doing y.backward() you correctly request the gradients of y, by doing y.grad you request the gradients with respect to y, which makes little sense. If you want the gradient of y with respect to x you need x.grad instead of y.grad.
Basically after calling y.backward() you should be able to get dy / dx0 using x.grad[0].
x = autograd.Variable(torch.FloatTensor([1, 2]), requires_grad=True)
y = 2 * x[0] + 3 * x[1]**2
y.backward()
print(x.grad[0], x.grad[1])