lixiaoquan commented on a change in pull request #6739:
URL: https://github.com/apache/incubator-tvm/pull/6739#discussion_r512350562
##########
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:
This kind of error may happen in runtime and hard to trace, I think it
is worth checking it here since it doesn't introduce a lot overhead.
----------------------------------------------------------------
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]