Skip to content

Commit

Permalink
Merge pull request #40 from fumiama/patch-1
Browse files Browse the repository at this point in the history
fix(filter): MPS framework doesn't support float64
  • Loading branch information
maxrmorrison authored Jun 17, 2024
2 parents e2c3058 + 09840ee commit dadc4a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchcrepe/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def median(signals, win_length):
mask = mask.contiguous().view(mask.size()[:3] + (-1,))

# Combine the mask with the input tensor
x_masked = torch.where(mask.bool(), x.double(), float("inf")).to(x)
x_masked = torch.where(mask.bool(), x.float(), float("inf")).to(x)

# Sort the masked tensor along the last dimension
x_sorted, _ = torch.sort(x_masked, dim=-1)
Expand Down

0 comments on commit dadc4a1

Please sign in to comment.