Hi,
I would like to call a function right after the backward pass on a module. It seems like the backward function, which does not really makes sense because the module definitely learns and update it weights.
My module is something like:
class BaseModule(nn.Module):
[...]
class MyModule(BaseModule):
def fct():
print("fct")
def backward(self, *args, **kwargs):
o = super(MyModule, self).backward(*args, **kwargs)
self.fct()
return o
In this case, I can put anything in fct
, it wont change anything.
I don’t get why this function isn’t called.
Any ideas?