We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6ffe1a commit e5dc18aCopy full SHA for e5dc18a
backends/transforms/view_copy_to_squeeze_unsqueeze.py
@@ -75,7 +75,11 @@ def find_unsqueeze_dim(
75
j = 0
76
idx = -1
77
while j < len(view_shape):
78
- if input_shape[i] != view_shape[j]:
+ # account for added dim being last dim in view_shape
79
+ if i == j and j == len(input_shape):
80
+ if view_shape[j] != 1:
81
+ return None
82
+ elif input_shape[i] != view_shape[j]:
83
if view_shape[j] == 1:
84
idx = j
85
i -= 1
0 commit comments