From ff539ef007abbc64b6b6c9846bc0c0fb28203d23 Mon Sep 17 00:00:00 2001 From: megemini Date: Thu, 5 Dec 2024 20:44:30 +0800 Subject: [PATCH] [Fix] transpose use numpy (#3933) --- paddlespeech/s2t/models/wav2vec2/modules/wav2vec2_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddlespeech/s2t/models/wav2vec2/modules/wav2vec2_model.py b/paddlespeech/s2t/models/wav2vec2/modules/wav2vec2_model.py index be78b516a..99cadc3ac 100644 --- a/paddlespeech/s2t/models/wav2vec2/modules/wav2vec2_model.py +++ b/paddlespeech/s2t/models/wav2vec2/modules/wav2vec2_model.py @@ -1267,7 +1267,7 @@ class TransposeLast(nn.Layer): def forward(self, x): if self.deconstruct_idx is not None: x = x[self.deconstruct_idx] - trans_dim = paddle.arange(x.dim()) + trans_dim = np.arange(x.dim()) trans_dim[-1], trans_dim[-2] = trans_dim[-2], trans_dim[-1] return x.transpose(trans_dim)