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

<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 27, 2020, 11:07am UTC](https://discuss.tvm.apache.org/t/quantized-models-and-legalization-pass/8253/6 "2020-10-27T11:07:45Z")

</div>

I got a bit confused above, sorry. It is not about the `inputs` but about the `tinfos`.

Just to avoid any additional confusion I tried to print the types of the interesting variables

**conv2d\_alter\_op(attrs, inputs, tinfos, out\_type)**

```auto
print(type(inputs[0]))
# <class 'tvm.relay.expr.Var'>

print(type(tinfos[0]))
# <class 'tvm.te.tensor.Tensor'>

```

**\_qnn\_conv2d\_legalize\_arm\_cpu(attrs, inputs, types)**

```auto
print(type(inputs[0]))
# <class 'tvm.relay.expr.Var'>
print(type(types[0]))
#<class 'tvm.ir.tensor_type.TensorType'>

```

The call to `relay.backend.compile_engine.select_implementation` asks to provide an array of `tvm.te.Tensor`s as its 3rd argument while I have (during legalization) only a `tvm.ir.TensorType` array.

So, the question still remains: is there a way to get a tensor during legalization?

---

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