From f0b7f5b995f6d1987b604d9e6e3da299f75c3fab Mon Sep 17 00:00:00 2001 From: megemini Date: Mon, 9 Dec 2024 20:29:20 +0800 Subject: [PATCH] [Fix] type promotion (#3944) --- paddlespeech/vector/io/signal_processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddlespeech/vector/io/signal_processing.py b/paddlespeech/vector/io/signal_processing.py index ee939bdb104..143d2a80a1b 100644 --- a/paddlespeech/vector/io/signal_processing.py +++ b/paddlespeech/vector/io/signal_processing.py @@ -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: