Skip to content

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
KentoNishi committed Jun 21, 2021
1 parent d95a218 commit abe436b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions torch_pitch_shift/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def __call__(
).to(input.device)
output = stretcher(output)
output = torch.istft(output[0], self._n_fft)
del resampler, stretcher
if output.shape[1] >= input.shape[1]:
return output[:, : (input.shape[1])]
return pad(output, pad=(0, input.shape[1] - output.shape[1], 0, 0))

0 comments on commit abe436b

Please sign in to comment.