I was reading again http://pytorch.org/docs/0.2.0/notes/extending.html 141 and I realized I didn’t alias the apply method. The problem is that even when I try with the Linear example provided in the docs, I get:
type object 'Linear' has no attribute 'apply'
I looked through the torch.nn source code and I saw that in the original Linear implementation apply is not used, in fact it is defined in pytorch/torch/nn/functionals.py.
Instead for example Bilinear is using it, even though an apply method is not defined anywhere in the Bilinear class in pytorch/torch/nn/_functions/linear.py.
Can someone explain and walk me through this?