IValue doesn’t have a .type() method since it’s a generic container for values (similar to Python’s PyObject). You should be able to just call .toTensor() to convert it to a tensor (make sure to guard it with a call to .isTensor() to make sure the IValue is what you expect).
You can find more details here 25. We are actively working on improving the JIT’s C++ API so issues like this will be more clear in the future.