masahi commented on a change in pull request #4418: [RUNTIME] Add cudnn conv3d
URL: https://github.com/apache/incubator-tvm/pull/4418#discussion_r350001983
 
 

 ##########
 File path: tests/python/contrib/test_cudnn.py
 ##########
 @@ -72,6 +72,67 @@ def verify():
 
     verify()
 
+def test_conv3d():
+    in_channel = 3
+    out_channel = 32
+    filter_d = 3
+    filter_h = 3
+    filter_w = 3
+    pad_d = 1
+    pad_h = 1
+    pad_w = 1
+    stride_d = 1
+    stride_h = 1
+    stride_w = 1
+    dilation_d = 1
+    dilation_h = 1
+    dilation_w = 1
+
+    xshape = [4, 3, 32, 32, 32]
+    if not tvm.module.enabled("cuda"):
+        print("skip because cuda is not enabled...")
+        return
+    if not tvm.get_global_func("tvm.contrib.cudnn.conv3d.output_shape", True):
+        print("skip because cudnn is not enabled...")
+        return
+    wshape = cudnn.conv3d_w_shape(in_channel,
+                              out_channel,
+                              filter_d,
+                              filter_h,
+                              filter_w)
+
+    X = tvm.placeholder(xshape, name='X')
+    W = tvm.placeholder(wshape, name='W')
+    Y = cudnn.conv3d_forward(X,
+                             W,
+                             stride_d,
+                             stride_h,
+                             stride_w,
+                             pad_d,
+                             pad_h,
+                             pad_w,
+                             dilation_d,
+                             dilation_h,
+                             dilation_w,
+                             conv_mode=1,
+                             tensor_format=0,
+                             algo=-1)
+    yshape = [x.value for x in Y.shape]
+    s =  tvm.create_schedule(Y.op)
+
+    def verify():
 
 Review comment:
   Similarly, use conv3d_ncdhw_python that you already have in your earlier PR 
to verify the output. 

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

Reply via email to