d-smirnov commented on a change in pull request #8509:
URL: https://github.com/apache/tvm/pull/8509#discussion_r803714895



##########
File path: tests/python/relay/test_pass_fuse_ops.py
##########
@@ -635,27 +635,31 @@ def before():
         out = relay.op.take(concat, indices=relay.const([0], dtype="int64"))
         return relay.Function(relay.analysis.free_vars(out), out)
 
-    def expected():
+    def expected(link_params):
         shape1 = (tvm.tir.const(10, "int64"), tvm.tir.const(1, "int64"))
         shape2 = (tvm.tir.const(1, "int64"),)
         x = relay.var("x", shape=shape1)
         p0 = relay.var("p0", shape=shape1)
         p1 = relay.var("p1", shape=shape2, dtype="int64")
         c = relay.const([0], dtype="int64")
         concat = relay.concatenate([p0, p0], axis=-1)
-        out = relay.op.take(concat, indices=p1)
+        out = relay.op.take(concat, indices=c if link_params else p1)
 
-        f0 = relay.Function([p0, p1], out)
+        f0 = relay.Function([p0] if link_params else [p0, p1], out)
         f0 = f0.with_attr("Primitive", tvm.tir.IntImm("int32", 1))
 
-        y = relay.Call(f0, [x, c])
+        y = relay.Call(f0, [x] if link_params else [x, c])
         return relay.Function([x], y)
 
-    orig = before()
-    m = fuse2(tvm.IRModule.from_expr(orig))
-    relay.build(m, "llvm")
-    after = run_opt_pass(expected(), transform.InferType())
-    assert tvm.ir.structural_equal(m["main"], after)
+    for link_params in [False, True]:

Review comment:
       Altered




-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to