tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] jwfromm commented on a change in pull request #5284: [Topi] Tensorcore support for Conv3D
Date Sun, 12 Apr 2020 07:45:49 GMT
jwfromm commented on a change in pull request #5284: [Topi] Tensorcore support for Conv3D
URL: https://github.com/apache/incubator-tvm/pull/5284#discussion_r407161101
 
 

 ##########
 File path: python/tvm/relay/op/nn/_nn.py
 ##########
 @@ -139,13 +139,17 @@ def convert_conv2d(attrs, inputs, tinfos, desired_layout):
     # pylint: disable=import-outside-toplevel
     from tvm import relay
     data, weight = inputs
-    assert desired_layout == 'NCHW', \
-            "Currently only transformation to NCHW layout is supported."
+    new_attrs = dict(attrs)
     if desired_layout == 'NCHW':
-        new_attrs = dict(attrs)
         new_attrs['data_layout'] = desired_layout
         new_attrs['kernel_layout'] = 'OIHW'
         return relay.nn.conv2d(data, weight, **new_attrs)
+    elif desired_layout == 'NHWC':
+        new_attrs['data_layout'] = desired_layout
+        new_attrs['kernel_layout'] = 'HWIO'
 
 Review comment:
   Good point, I added a depthwise check 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


With regards,
Apache Git Services

Mime
View raw message