Creating a graph did not work for me. I get errors. It turns out that apply_func in graphgen.lua runs the original updateOutput again (after the first forward() call) via base_func. This goes wrong for any layer that somehow creates a new tensor because then the new tensor pointer cannot be found in the nodes table. A simple fix is to do just "return self.output" in those cases.