Could you remove the numpy() call from self.c and rerun the code?
Generally, if you don’t need to use another lib, I would recommend to use PyTorch methods only.
This will make sure that Autograd is able to keep track of all operations and create the backward pass for you automatically.
If you need to use another lib such as numpy, you would need to implement the backward function manually.
That being said, the current error is thrown, since out is a numpy array and you are trying to apply torch.pow on it.