# Quantized models and legalization pass

**URL:** <https://discuss.tvm.apache.org/t/quantized-models-and-legalization-pass/8253>\
**Category:** Development\
**Created:** [October 22, 2020, 10:34pm UTC](https://discuss.tvm.apache.org/t/quantized-models-and-legalization-pass/8253 "2020-10-22T22:34:22Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![anijain2305](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/anijain2305/32/1513_2.png) [@anijain2305](https://discuss.tvm.apache.org/u/anijain2305)\
**Post date:** [October 28, 2020, 7:52pm UTC](https://discuss.tvm.apache.org/t/quantized-models-and-legalization-pass/8253/7 "2020-10-28T19:52:25Z")

</div>

Sorry for late reply. Can you try this? tinfo is nothing but just te placeholder.

```auto
diff --git a/python/tvm/relay/qnn/op/legalizations.py b/python/tvm/relay/qnn/op/legalizations.py
index 50e5a02f8..8add434c1 100644
--- a/python/tvm/relay/qnn/op/legalizations.py
+++ b/python/tvm/relay/qnn/op/legalizations.py
@@ -295,6 +295,10 @@ def _qnn_dense_legalize_arm_cpu(attrs, inputs, types):
 @qnn_conv2d_legalize.register("cpu")
 def _qnn_conv2d_legalize_intel_cpu(attrs, inputs, types):
     # The VNNI transformations prefer uint8 x int8 datatypes.
+ data_type = types[0]
+ data_tinfo = tvm.te.placeholder(shape=data_type.shape, dtype=data_type.dtype)
+ print(data_tinfo)
+
     if is_fast_int8_on_intel():
         return helper_change_dtypes_to_uint8_int8(attrs, inputs, types, relay.qnn.op.conv2d)
     return helper_no_fast_int8_hw_legalization(attrs, inputs, types, relay.nn.conv2d)

```

If not, we can change Legalize to accept one more argument, but thats more invasive.

---

_[View the full topic](https://discuss.tvm.apache.org/t/quantized-models-and-legalization-pass/8253)._
