Skip to content

Commit

Permalink
fix: convert src to tensor in torch frontend scatter_
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Armstrong committed Jul 4, 2024
1 parent 787b7ba commit 7b46175
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ivy/functional/frontends/torch/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,9 @@ def scatter_add_(self, dim, index, src):
{"2.2 and below": ("float32", "float64", "int32", "int64")}, "torch"
)
def scatter_(self, dim, index, src, *, reduce=None):
if not isinstance(src, torch_frontend.Tensor):
src = torch_frontend.tensor(src, dtype=self.dtype)

if reduce is None:
reduce = "replace"
else:
Expand Down

0 comments on commit 7b46175

Please sign in to comment.