n><span class="p">()]</span>
<span class="k">with</span> <span class="n">torch</span><span class="o">.</span><span class="n">no_grad</span><span class="p">():</span>
    <span class="n">new_batch_size_outputs</span> <span class="o">=</span> <span class="n">optimized_model</span><span class="p">(</span><span class="o">*</span><span class="n">new_batch_size_inputs</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="avoid-recompilation-by-specifying-dynamic-shapes-before-torch-trt-compil