Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
ezyang committed Apr 29, 2024
1 parent c69c690 commit 5cad1e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion torch/_refs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3715,7 +3715,10 @@ def _reshape_view_helper(a: TensorLikeType, *shape, allow_copy: bool) -> TensorL

# Squeezes tail
while idx < a_.ndim:
assert a_.shape[idx] == 1
torch._check(
a_.shape[idx] == 1,
lambda: f"a.size({idx}) expected to be 1 but got {a_.shape[idx]}",
)
a_ = squeeze(a_, idx)

return a_
Expand Down

0 comments on commit 5cad1e7

Please sign in to comment.