Numpy does not provide an autograd engine, so you won’t be able to automatically differentiate your operations in numpy.
If you want to use numpy methods in the forward pass, you could implement the backward manually by writing a custom torch.autograd.Function as described here 9.