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/17 22:04:35 UTC

[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #6509: [Relay]Allow dynamic batch for arm conv2d

kevinthesun commented on a change in pull request #6509:
URL: https://github.com/apache/incubator-tvm/pull/6509#discussion_r490587838



##########
File path: tests/python/relay/test_any.py
##########
@@ -423,6 +424,48 @@ def test_any_reshape_like():
     check_result([data_np, shape_like_np], mod, shape_like_np.shape, assert_shape=True)
 
 
+def verify_any_conv2d(
+    data_shape,
+    kernel_shape,
+    strides,
+    padding,
+    dilation,
+    static_data_shape,
+    ref_out_shape,
+):
+    mod = tvm.IRModule()
+    dtype = "float32"
+    data = relay.var("data", shape=data_shape, dtype=dtype)
+    kernel = relay.var("kernel", shape=kernel_shape, dtype=dtype)
+    y = relay.nn.conv2d(data, kernel, strides, padding, dilation, kernel_size=kernel_shape[2:4])
+    mod["main"] = relay.Function([data, kernel], y)
+    data_np = np.random.uniform(size=static_data_shape).astype(dtype)
+    kernel_np = np.random.uniform(size=kernel_shape).astype(dtype)
+    check_result([data_np, kernel_np], mod, ref_out_shape, assert_shape=True)
+
+
+# TODO(@kevinthesun): Support dynamic input height and width.

Review comment:
       I think gpu also requires some changes for this. We can do that in a seperate PR and I'll add a TODO here.




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