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 2021/09/16 21:19:27 UTC

[GitHub] [tvm] masahi commented on a change in pull request #9030: [CUDA] Fix dense tensorcore legalize type error when units is specified

masahi commented on a change in pull request #9030:
URL: https://github.com/apache/tvm/pull/9030#discussion_r710495653



##########
File path: python/tvm/topi/cuda/tensorcore_alter_op.py
##########
@@ -176,6 +176,12 @@ def _dense_legalize(attrs, inputs, arg_types):
 
     x_ = relay.nn.pad(x, pad_width=((0, dm), (0, dk))) if dm or dk else x
     y_ = relay.nn.pad(y, pad_width=((0, dn), (0, dk))) if dn or dk else y
+
+    # If units is explicitly specified, it is used to compute the output shape.
+    # We need to update units after padding to prevent a type error.
+    if attrs["units"] is not None:
+        new_attrs["units"] = N + dn

Review comment:
       `units` is specified by frontends. For example, PT and ONNX use it, while TF frontend doesn't. Actually I wonder why no one has hit this error before.




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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org