The “Problem” here is, that PyTorch creates a dynamic computation graph at runtime, which is great for prototyping and allowing us to use python’s native flow-control operations, but unfortunately it makes it very hard to deploy models.
To tackle this problem, torch.jit traces the dynamically created graph and compiles it into a static version, which can be deployed e.g. via C++ without the need to reimplement the model’s logic.