Solved by solvingPuzzles in post #2 
              
              
                …I ended up making nn.Module wrappers for anonymous functions such as MatMul for my net. Not the most elegant solution, but it worked for my use-case.