Hi,
The gradients are computed using backpropagation. So to get the gradients for a module, you need all use of its output to be done by differentiable functions.
If you do:
a = func1(input)
b = module(a)
c = func2(b)
loss = crit(c)

And your learnable parameters are in module.
You will need func2 and crit to be differentiable. But not func1.