Nice. Thanks.
Going further, I am not able to update a tensor using its gradient. The following code raises a exception:
float lr = 1e-4;
at::Tensor b = torch::randn({1}, torch::requires_grad(true));
[...]
b -= lr * b.grad();

The exception says:
a leaf Variable that requires grad has been used in an in-place operation.
The python version of the code reads:
b.data -= learning_rate * b.grad.data

I am having lots of trouble finding the correspondence between the 2 API. Is there any documentation that could help me there?
Thanks!