[Apache TVM Discuss] [Questions] If_scope in ir_builder

2021-03-08 Thread Michael via Apache TVM Discuss
Thank you @leeexyz. Yeah, we can use ```tvm.tir.const``` or a new buffer. I means, it there any mechanism to prevent users using python variables within a ```if_scope```. For example, error message to tell users to utilize ```tvm.tir.const``` since it's quite easy to confuse the python varia

[Apache TVM Discuss] [Questions] If_scope in ir_builder

2021-03-08 Thread leeexyz via Apache TVM Discuss
Hi @SYangDong, use `b = tvm.tir.const(100, dtype="float32")` instead of the assgiment directly. --- [Visit Topic](https://discuss.tvm.apache.org/t/if-scope-in-ir-builder/9332/2) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [c

[Apache TVM Discuss] [Questions] If_scope in ir_builder

2021-03-08 Thread Michael via Apache TVM Discuss
Hi, I'm using the ir_builder to contrust a cuda kernel, but I encounter a problem of if_scope ``` ib = tvm.tir.ir_builder.create() n = te.size_var("n") A = ib.pointer("float32", name="A") tmod = tvm.tir.truncmod with ib.for_range(0, n, name="i") as i: with ib.if_scope(tm