masahi commented on a change in pull request #4418: [RUNTIME] Add cudnn conv3d
URL: https://github.com/apache/incubator-tvm/pull/4418#discussion_r351197316
##########
File path: tests/python/contrib/test_cudnn.py
##########
@@ -67,22 +71,109 @@ def verify_conv2d(data_dtype, conv_dtype,
tensor_format=0):
def verify():
ctx = tvm.gpu(0)
f = tvm.build(s, [X, W, Y], "cuda", target_host="llvm", name="conv2d")
- x = tvm.nd.array(np.random.uniform(-1, 1, xshape).astype(data_dtype),
- ctx)
- w = tvm.nd.array(np.random.uniform(-1, 1, wshape).astype(data_dtype),
- ctx)
- y = tvm.nd.array(np.random.uniform(-1, 1, yshape).astype(data_dtype),
- ctx)
+ x_np = np.random.uniform(-1, 1, xshape).astype(data_dtype)
+ w_np = np.random.uniform(-1, 1, wshape).astype(data_dtype)
+ y_np = np.zeros(yshape).astype(data_dtype)
+ x = tvm.nd.array(x_np, ctx)
+ w = tvm.nd.array(w_np, ctx)
+ y = tvm.nd.array(y_np, ctx)
+ if tensor_format == 0:
+ c_np = topi.testing.conv2d_nchw_python(x_np, w_np, 1, 1)
+ elif tensor_format == 1:
+ wt = w_np.transpose((1, 2, 3, 0)) #OHWI => HWIO
Review comment:
You don't need this line if you set the wshape at line 52 correctly.
----------------------------------------------------------------
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]
With regards,
Apache Git Services