Problem about quantization using PTSQ: RuntimeError: "rsqrt_cpu" not implemented for "Half"

ChenGongfu: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/4/e49b3f2e8293ec6b2df552628255dd443da25b38.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/e49b3f2e8293ec6b2df552628255dd443da25b38" title="IMG_20230216_143710"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/e/4/e49b3f2e8293ec6b2df552628255dd443da25b38_2_690x310.jpeg" alt="IMG_20230216_143710" data-base62-sha1="wCltDrUJvhK6se9xGKNNlFCuQ9G" width="690" height="310" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/e/4/e49b3f2e8293ec6b2df552628255dd443da25b38_2_690x310.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/e/4/e49b3f2e8293ec6b2df552628255dd443da25b38_2_1035x465.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/e/4/e49b3f2e8293ec6b2df552628255dd443da25b38_2_1380x620.jpeg 2x" data-dominant-color="86857F"><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">IMG_20230216_143710</span><span class="informations">1920×864 203 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>

ChenGongfu: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/1/8175000e4d8aa5c6c7dcb89d2cf98f55a09e995c.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/8175000e4d8aa5c6c7dcb89d2cf98f55a09e995c" title="IMG_20230216_143926"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/1/8175000e4d8aa5c6c7dcb89d2cf98f55a09e995c_2_690x310.jpeg" alt="IMG_20230216_143926" data-base62-sha1="itegszWO4zEhi3WQaGnbV6hrd80" width="690" height="310" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/1/8175000e4d8aa5c6c7dcb89d2cf98f55a09e995c_2_690x310.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/8/1/8175000e4d8aa5c6c7dcb89d2cf98f55a09e995c_2_1035x465.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/8/1/8175000e4d8aa5c6c7dcb89d2cf98f55a09e995c_2_1380x620.jpeg 2x" data-dominant-color="888582"><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">IMG_20230216_143926</span><span class="informations">1920×864 156 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>

ChenGongfu: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/9/69fcffa3775c5e36d78741084793d512398db4b1.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/69fcffa3775c5e36d78741084793d512398db4b1" title="IMG_20230216_143732"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/9/69fcffa3775c5e36d78741084793d512398db4b1_2_690x310.jpeg" alt="IMG_20230216_143732" data-base62-sha1="f7Cbfc3NdviFqvrw7WDJ5g4DxCN" width="690" height="310" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/9/69fcffa3775c5e36d78741084793d512398db4b1_2_690x310.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/6/9/69fcffa3775c5e36d78741084793d512398db4b1_2_1035x465.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/6/9/69fcffa3775c5e36d78741084793d512398db4b1_2_1380x620.jpeg 2x" data-dominant-color="918B87"><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">IMG_20230216_143732</span><span class="informations">1920×864 197 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>

ptrblck: <p><code>float16</code> operations are mostly not supported on CPU which is why the error is raised.<br>
I’m not familiar with your use case, but you might want to use the GPU if you are interested in using mixed-precision training with <code>float16</code>.<br>
PS: you can post code snippets by wrapping them into three backticks ```, which would make debugging easier as the images are quite hard to read.</p>