Skip to content

Commit

Permalink
Fix DecomposeMultiDimSqueeze callback failure (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
meenakshiramanathan1 authored Jan 17, 2025
2 parents c566aae + 3e17dbe commit 4304c2f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/tvm/relay/op/contrib/forge/forge_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,9 @@ def __init__(self):
def callback(self, pre, post, node_map):
act = node_map[self.act][0]
axis = post.attrs.axis
# Skip removal of squeeze which contain dynamic shapes
if any([isinstance(dim, tvm.tir.expr.Any) for dim in pre.checked_type.shape]):
return post
input_shape = [int(dim) for dim in pre.args[0].checked_type.shape]
if axis is None:
# PyTorch's `squeeze_()` removes all dimensions of size 1.
Expand Down

0 comments on commit 4304c2f

Please sign in to comment.