Fuse_modules for conv bn relu not working

MrOCW: <p>Hi, I am trying QAT for YOLOv5 and this is the 1st portion of the model<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/9/59a384e188892e312a429e3f342a94df809158ba.png" data-download-href="https://discuss.pytorch.org/uploads/default/59a384e188892e312a429e3f342a94df809158ba" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/5/9/59a384e188892e312a429e3f342a94df809158ba.png" alt="image" data-base62-sha1="cMYPDupfLWdMMivw13pAn61T8ds" width="690" height="222" data-dominant-color="38162D"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">834×269 37.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
Using:<br>
<code>torch.quantization.fuse_modules(module, [["conv","bn","relu"]],inplace=True)</code><br>
the model does not seemed fused<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/3/8/38354f1a6a11a8a3ca23e58d5374381289ee7245.png" data-download-href="https://discuss.pytorch.org/uploads/default/38354f1a6a11a8a3ca23e58d5374381289ee7245" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/3/8/38354f1a6a11a8a3ca23e58d5374381289ee7245_2_690x303.png" alt="image" data-base62-sha1="81eX2OfzkiYsmJGFwz5K8NCJo8t" width="690" height="303" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/3/8/38354f1a6a11a8a3ca23e58d5374381289ee7245_2_690x303.png, https://discuss.pytorch.org/uploads/default/optimized/3X/3/8/38354f1a6a11a8a3ca23e58d5374381289ee7245_2_1035x454.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/3/8/38354f1a6a11a8a3ca23e58d5374381289ee7245_2_1380x606.png 2x" data-dominant-color="37152D"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1590×699 119 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Whereas if i use:<br>
<code>torch.quantization.fuse_modules(module, [["conv","bn"]],inplace=True)</code><br>
the model is fused<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/9/899561128121d8b14b2d1d375c9dc16f74d342aa.png" data-download-href="https://discuss.pytorch.org/uploads/default/899561128121d8b14b2d1d375c9dc16f74d342aa" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/9/899561128121d8b14b2d1d375c9dc16f74d342aa_2_690x294.png" alt="image" data-base62-sha1="jD7skgZ2tfyNMBC5rs4AdS1kDcS" width="690" height="294" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/9/899561128121d8b14b2d1d375c9dc16f74d342aa_2_690x294.png, https://discuss.pytorch.org/uploads/default/optimized/3X/8/9/899561128121d8b14b2d1d375c9dc16f74d342aa_2_1035x441.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/8/9/899561128121d8b14b2d1d375c9dc16f74d342aa_2_1380x588.png 2x" data-dominant-color="36142C"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1601×683 111 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Is this a bug?</p>

Vasiliy_Kuznetsov: <p>Looking at the screenshot, is the relu stored under “act”?  Could you try</p>
<pre><code class="lang-auto">torch.quantization.fuse_modules(module, [["conv","bn","act"]],inplace=True)
</code></pre>