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:
[email protected]
With regards,
Apache Git Services