This is probably a silly question but I’m having a difficult time learning the autograd API and the Symbol API. I can’t seem to figure out how to compute the gradient of a function when the function is using symbols and not NDArrays. For example:

```
x_in = mx.nd.array([2])
x_in.attach_grad()
X = mx.sym.Variable("X")
with autograd.record():
F = X * X
execute = F.bind(ctx=mx.cpu(0),args={'X' : x_in})
out = execute.forward()
grad = autograd.grad(out[0], [x])
```

This code gives an error: “Cannot differentiate node because it is not in a computational graph.”

I feel like I’m missing some sort of fundamental information about how the autograd api and symbol api work, but I can’t seem to find examples of gradients being calculated with symbols.

Thanks for any help!