You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/09/03 22:34:16 UTC

[GitHub] [incubator-tvm] mbrookhart commented on a change in pull request #6396: [Relay][Op] Fix Reshape Compute

mbrookhart commented on a change in pull request #6396:
URL: https://github.com/apache/incubator-tvm/pull/6396#discussion_r483288604



##########
File path: tests/python/relay/test_any.py
##########
@@ -801,6 +801,23 @@ def test_any_ndarray_size():
     verify_any_ndarray_size((2, 2))
     verify_any_ndarray_size((1, 2, 3, 4))
 
+def test_reshape_concat():
+    d0 = relay.var("d0", shape=any_dims(2), dtype='float32')
+    d1 = relay.var("d1", shape=any_dims(3), dtype='float32')
+    out = relay.op.concatenate([relay.op.reshape(d0, [-1]), relay.op.reshape(d1, [-1])], axis=0)
+    mod = tvm.IRModule()
+    mod['main'] = relay.Function([d0, d1], out)
+    relay.create_executor("vm", mod=mod, ctx=tvm.cpu(), target="llvm")
+
+    d0 = relay.var("d0", shape=any_dims(2), dtype='float32')
+    d1 = relay.var("d1", shape=any_dims(2), dtype='float32')
+    s0 = relay.var("s0", shape=any_dims(3), dtype='float32')
+    s1 = relay.var("s1", shape=any_dims(3), dtype='float32')
+    out = relay.op.concatenate([relay.op.reshape_like(d0, s0), relay.op.reshape_like(d1, s1)], axis=0)
+    mod = tvm.IRModule()
+    mod['main'] = relay.Function([d0, d1, s0, s1], out)
+    relay.create_executor("vm", mod=mod, ctx=tvm.cpu(), target="llvm")

Review comment:
       I'd love to see the test executed, not just constructed.




----------------------------------------------------------------
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:
users@infra.apache.org