Hi,
We cannot automatically track gradients for numpy Tensors I’m afraid. You will have to either stick with pytorch Tensor or write the backward computation explicitly as described here: Extending PyTorch — PyTorch 1.8.0 documentation 9