Skip to content

Commit

Permalink
fix(ivy): Resolve shape mismatch bug in the return of the torch backe…
Browse files Browse the repository at this point in the history
…nd of ivy.median
  • Loading branch information
AnnaTz committed Aug 31, 2023
1 parent 79ab5c8 commit dc8ccbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ivy/functional/backends/torch/experimental/statistical.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ def median(
interpolation="midpoint",
)
if input.dtype in [torch.int64, torch.float64]:
ret = torch.asarray(ret, dtype=torch.float64)
ret = ret.to(torch.float64)
elif input.dtype in [torch.float16, torch.bfloat16]:
ret = torch.asarray(ret, dtype=input.dtype)
ret = ret.to(input.dtype)
else:
ret = torch.asarray(ret, dtype=torch.float32)
ret = ret.to(torch.float32)
return ret


Expand Down

0 comments on commit dc8ccbc

Please sign in to comment.