Skip to content

Commit

Permalink
Return dynamic inputs in DecomposeMultiDimSqueeze callback
Browse files Browse the repository at this point in the history
  • Loading branch information
meenakshiramanathan1 committed Dec 10, 2024
1 parent 38d2522 commit 396ac87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/tvm/relay/op/contrib/forge/forge_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,8 @@ def __init__(self):
def callback(self, pre, post, node_map):
act = node_map[self.act][0]
axis = post.attrs.axis
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]
adjusted_axes = [(ax - len(input_shape)) if ax >= 0 else ax for ax in axis]
assert all(ax < 0 for ax in adjusted_axes), "Invalid squeeze dimension: all axes must be negative."
Expand Down

0 comments on commit 396ac87

Please sign in to comment.