hzfan commented on a change in pull request #5235:
URL: https://github.com/apache/incubator-tvm/pull/5235#discussion_r453268159



##########
File path: tests/python/relay/test_pass_fuse_ops.py
##########
@@ -621,6 +621,81 @@ def expected():
     after = run_opt_pass(expected(), transform.InferType())
     assert tvm.ir.structural_equal(zz, after)
 
+
+def test_fuse_take():

Review comment:
       Sure. It may cause problems when fusing i32 indices with i64 indices. A 
simplified example:
   
   ```
   i64_2 = tvm.tir.const(2, "int64")
   i64_4 = tvm.tir.const(4, "int64")
   i32_2 = tvm.tir.const(2, "int32")
   a = te.placeholder((i64_4, i64_4), "a")
   b = te.compute((i64_2, i64_2), lambda i, j: a[i + 2, j + 2])
   c = te.compute((i32_2, i32_2), lambda i, j: b[2- i, 2 - j] + 1)
   ```
   
   When fusing `b` into `c`, the i64 variables in `b` (`i` and `j`) are 
replaced by i32 expressions in `c` (`2 - i` and `2 - j`), which does not make 
sense.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to