4 ms·
It makes it possible to lift your model out of python while handling programming constructs like loops and if statements (see torch.jit.script). It also makes
by m_ke 5y ago
It makes it possible to lift your model out of python while handling programming constructs like loops and if statements (see torch.jit.script).
It also makes it possible to sidestep the GIL and remove the overhead of launching kernels from python, which only really makes a noticeable difference with models that queue up a lot of small operations on the GPU. (LSTMs are an example of where this would make a difference https://pytorch.org/blog/optimizing-cuda-rnn-with-torchscript/ https://pytorch.org/blog/optimizing-cuda-rnn-with-torchscrip...)