The core difference between PyTorch and Theano you’re wondering about here is that in Theano you create a symbolic graph that you then feed into function to have it compiled to a function you can call while in PyTorch you write your calculation and PyTorch runs it as you write.
Modules are decidedly only there to hold learnable parameters / state - see Jeremy Howard’s recently added tutorial 5.
Now you could assemble lines of Python and then eval it to form your function, but quite likely, you’re not making the best use of PyTorch that way. One of the things people like about PyTorch is that you don’t have the create graph -> compile -> run workflow.
Best regards
Thomas