tvm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yinghai Lu via TVM Discuss <nore...@discuss.tvm.ai>
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])
  %0
}
```
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]
  %0
}
```
Notice the heterogenous tensor shape type for `%0`, which breaks the downstream compilation.
I looked around the code at 
https://github.com/dmlc/tvm/blob/5f89a50e32c82233689623502f377a518aaa35f6/src/relay/op/tensor/transform.cc#L500
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](https://discuss.tvm.ai/t/how-to-debug-and-print-out-content-of-indexexpr/2039/1)
to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/ddd56d70711f5e7f9090ed35fcaaf4795b6f94f745d43e567ba95c7877b17ded).

Tianqi Chen, UW, Seattle, WA, 98105, United States
http://tracking.discuss.tvm.ai/tracking/unsubscribe?msgid=vdR5bitIkcGZc_SvSMixrw2
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message