Yes,
As long as you just want to change what your function outputs and you can implement everything with pytorch methods, then you can stick with nn.Module.
If it’s not implemented  in pytorch or you want your backward pass not to represent the “true” derivative of your forward pass (to get wrong but smoother gradients for example), then you should work with autograd.Function.