Consider a nn.Module-derived class A
.
Then using signature
from the Python inspect
module
>>> print(inspect.signature(A))
(*input, **kwargs)
appropriately produces the signature of the the forward
method of torch.nn.Module
.
Is it possible to change this behavior to more accurately reflect the signature of the callable A
?
E.g., if the forward
-method of A
reads
def forward(a, b, c)
...
is it somehow possible to get
>>> print(inspect.signature(A))
(a, b, c)
?
Thanks!