lass="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">torch</span>
<span class="kn">import</span> <span class="nn">torch_tensorrt</span>
</pre></div>
</div>
<p>Then given a TorchScript module, you can compile it with TensorRT using the <code class="docutils literal notranslate"><span class="pre">torch._C._jit_to_backend(&quot;tensorrt&quot;,</span> <span class="pre">...)</span></code> API.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><sp