Skip to content

Commit

Permalink
[Fix] type promotion (#3944)
Browse files Browse the repository at this point in the history
  • Loading branch information
megemini authored Dec 9, 2024
1 parent e4038b4 commit f0b7f5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddlespeech/vector/io/signal_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def compute_amplitude(waveforms, lengths=None, amp_type="avg", scale="linear"):
out = paddle.mean(paddle.abs(waveforms), axis=1, keepdim=True)
else:
wav_sum = paddle.sum(paddle.abs(waveforms), axis=1, keepdim=True)
out = wav_sum / lengths
out = wav_sum / lengths.astype(wav_sum.dtype)
elif amp_type == "peak":
out = paddle.max(paddle.abs(waveforms), axis=1, keepdim=True)
else:
Expand Down

0 comments on commit f0b7f5b

Please sign in to comment.