tvm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yinghai Lu via TVM Discuss <>
Subject [TVM Discuss] [Development] How to debug and print out content of IndexExpr?
Date Thu, 28 Mar 2019 10:51:09 GMT

I noticed that the relay tensor shape type will be converted to `int32_t` after shape inference,
however, if IndexExpr arithmetics is involved, the shape type will be preserved, which breaks
the following example
fn (%X: Tensor[(int64(7), int64(16)), float32]) {
  %0 = reshape(%X, newshape=[7, -1, 1])
After shape inference, it becomes
fn (%X: Tensor[(int64(7), int64(16)), float32])
    -> Tensor[(7, int64(16), 1), float32] {
  %0 = reshape(%X, newshape=[7, -1, 1]) # ty=Tensor[(7, int64(16), 1), float32]
Notice the heterogenous tensor shape type for `%0`, which breaks the downstream compilation.
I looked around the code at
but didn't find suspicious things. And I would like to inject some debugging code to print
out the content of `IndexExpr` in C++. Anyone knows how to do this? Thanks.

[Visit Topic](
to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](

Tianqi Chen, UW, Seattle, WA, 98105, United States
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message