Hi,

You should not modify the __call__ method on nn.Module, it use used (especially for hooks). You should only define the forward() method.
Only pytorch’s own functions are tracked by the autograd. So you cannot use numpy functions. If you need a function that is not in pytorch, you will need to do create a new autograd.Function 1 and implement the backward yourself.