For those who want to implement their own modules, we suggest using
the nn.Jacobian
class for testing the derivatives of their class,
together with the torch.Tester class. The sources
of nn
package contains sufficiently many examples of such tests.