Merge pull request #142 from magic-akari/fix/f0_to_coarse

fix: cast `f0_coarse` to int
This commit is contained in:
謬紗特 2023-04-11 22:43:01 +08:00 committed by GitHub
commit 05f9305fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -205,7 +205,7 @@ def f0_to_coarse(f0):
f0_mel[f0_mel <= 1] = 1
f0_mel[f0_mel > f0_bin - 1] = f0_bin - 1
f0_coarse = (f0_mel + 0.5).long() if is_torch else np.rint(f0_mel).astype(np.int)
f0_coarse = (f0_mel + 0.5).int() if is_torch else np.rint(f0_mel).astype(np.int)
assert f0_coarse.max() <= 255 and f0_coarse.min() >= 1, (f0_coarse.max(), f0_coarse.min())
return f0_coarse