Solved by tom in post #2 
              
              
                The typical thing is to use the JIT to trace or script your model. This is - at a very high level - somewhat similar as the computational graph in TensorFlow.