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 2020/10/26 19:11:07 UTC

[GitHub] [incubator-tvm] electriclilies commented on a change in pull request #6739: [Relay] Fix dynamic case for Squeeze and Split

electriclilies commented on a change in pull request #6739:
URL: https://github.com/apache/incubator-tvm/pull/6739#discussion_r512200603



##########
File path: python/tvm/relay/op/_transform.py
##########
@@ -575,11 +575,14 @@ def transpose_shape_func(attrs, inputs, _):
 
 
 @script
-def _squeeze_shape_func(data_shape, keep_axes):
+def _squeeze_shape_func(data_shape, keep_axes, remove_axes):
     out = output_tensor((len(keep_axes),), "int64")
     for i in const_range(len(keep_axes)):
         out[i] = data_shape[keep_axes[i]]
 
+    for i in const_range(len(remove_axes)):
+        assert data_shape[remove_axes[i]] == 1, "Removed dimension must have size 1"
+

Review comment:
       I think having a user-facing error here is good. If an incorrect shape is sent to a topi function, it sometimes looks like an internal error, not a user error, and causes confusion in general. I would keep the check. 




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