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

<div class="post-metadata">

**Author:** ![giuseros](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/giuseros/32/803_2.png) [@giuseros](https://discuss.tvm.apache.org/u/giuseros)\
**Post date:** [October 26, 2020, 3:56pm UTC](https://discuss.tvm.apache.org/t/quantized-models-and-legalization-pass/8253/4 "2020-10-26T15:56:05Z")

</div>

Thanks for the reply, @FrozenGene!

The signatures of the two functions are:

```auto
def _alter_conv2d_layout(attrs, inputs, types, out_type):

```

```auto
def _qnn_conv2d_legalize_arm_cpu(attrs, inputs, types):

```

While they look similar, `inputs` in `_alter_conv2d_layout` contains actual `Tensor`s while `inputs` in `_qnn_conv2d_legalize_arm_cpu` are of class `tvm.relay.expr.Var`.

Is there a way to get the tensors during legalization from variables of type `tvm.relay.expr.Var`?

Thanks a lot,

Giuseppe

---

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