Skip to content

Commit

Permalink
Fix PyTorch scalar reshape
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Dec 29, 2024
1 parent 37db76d commit 167980e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions phiml/backend/torch/_torch_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ def grid_sample(self, grid, coordinates, extrapolation: str):
return result

def reshape(self, value, shape):
if not shape:
return value
value = self.as_tensor(value)
if value.is_contiguous():
return value.view(*shape)
Expand Down

0 comments on commit 167980e

Please sign in to comment.