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)
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)
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?