Is is possible to define the backward() function in nn.module?
Or do I have to use torch.autograd.Function? (as in https://github.com/jcjohnson/pytorch-examples#pytorch-defining-new-autograd-functions 249)
This module will have its trainable parameters. The backward gradient depend on the parameters. Does torch.autograd.Function support trainable prameters?
i.e. can I have  torch.nn.Parameter(…) in torch.autograd.Function?