# 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:** 8

<div class="post-metadata">

**Author:** ![FrozenGene](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/frozengene/32/1114_2.png) [@FrozenGene](https://discuss.tvm.apache.org/u/FrozenGene)\
**Post date:** [October 29, 2020, 5:54am UTC](https://discuss.tvm.apache.org/t/quantized-models-and-legalization-pass/8253/8 "2020-10-29T05:54:25Z")

</div>

@giuseros @anijain2305 Let us accept one more argument like `alter_op_layout`

```auto
@tvm.target.generic_func
def conv2d_alter_layout(attrs, inputs, tinfos, out_type):

@tvm.target.generic_func
def qnn_conv2d_legalize(attrs, inputs, types):
    """Default legalization is None."""
    return None

```

Then we could leverage `relay.backend.compile_engine.select_implementation`

---

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