QAT QuantizedConv2d converted to ONNX format

username: xiangyun
cooked: <p>when QuantizedConv2d converted to onnx format,because bias precisoin is float32,so is there a way not converter the bias to dequantized node?<br>
I use qat.<br>
code is:</p>
<p>model_prepared = quantize_fx.prepare_qat_fx(model_to_quantize, qconfig_mapping=qconfig_mapping, example_inputs=dummy_input, backend_config=backend_config_s)<br>
model_quantized = quantize_fx.convert_fx(model_prepared)<br>
dummy_input = dummy_input.to(device)<br>
model_quantized.eval()<br>
torch.onnx.export(model_quantized, dummy_input, “saved_models/quantized_model.onnx”,<br>
verbose = False,<br>
input_names = [‘input’],<br>
output_names = [‘output’],<br>
keep_initializers_as_inputs=True<br>
)</p>
<p>thank very much!!!<br>
now is:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/a/7abc8b24dce46eb07600deee31e21c82504ef7ea.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/7abc8b24dce46eb07600deee31e21c82504ef7ea" title="now"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/7/a/7abc8b24dce46eb07600deee31e21c82504ef7ea_2_690x300.jpeg" alt="now" data-base62-sha1="hvMcEmdxHax20f9WhMizbwQb17c" width="690" height="300" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/7/a/7abc8b24dce46eb07600deee31e21c82504ef7ea_2_690x300.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/7/a/7abc8b24dce46eb07600deee31e21c82504ef7ea_2_1035x450.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/7/a/7abc8b24dce46eb07600deee31e21c82504ef7ea_2_1380x600.jpeg 2x" data-dominant-color="EEEEEE"><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">now</span><span class="informations">1415×616 68.8 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>
target is:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/d/c/dc8f6a15504c3f94e067bd1d6de85e6e214e5c3d.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/dc8f6a15504c3f94e067bd1d6de85e6e214e5c3d" title="target"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/d/c/dc8f6a15504c3f94e067bd1d6de85e6e214e5c3d_2_690x358.jpeg" alt="target" data-base62-sha1="vtaj3FMZrJ8qvNM0t9tWIdARUi9" width="690" height="358" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/d/c/dc8f6a15504c3f94e067bd1d6de85e6e214e5c3d_2_690x358.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/d/c/dc8f6a15504c3f94e067bd1d6de85e6e214e5c3d_2_1035x537.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/d/c/dc8f6a15504c3f94e067bd1d6de85e6e214e5c3d_2_1380x716.jpeg 2x" data-dominant-color="EFEFEF"><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">target</span><span class="informations">1386×721 78.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></p>

username: jerryzh168
cooked: <p>please open an issue in <a href="https://github.com/onnx/onnx/issues" class="inline-onebox" rel="noopener nofollow ugc">Issues · onnx/onnx · GitHub</a> directly</p>