From 5c9bdfa238560b9c4a8d8a7d4b56c28496a3e094 Mon Sep 17 00:00:00 2001
From: aky15 <ankeyuthu@gmail.com>
Date: 星期四, 14 九月 2023 16:12:53 +0800
Subject: [PATCH] Merge pull request #952 from alibaba-damo-academy/aky15-patch-1
---
funasr/models/encoder/fsmn_encoder.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/funasr/models/encoder/fsmn_encoder.py b/funasr/models/encoder/fsmn_encoder.py
index c749dc4..38d164d 100755
--- a/funasr/models/encoder/fsmn_encoder.py
+++ b/funasr/models/encoder/fsmn_encoder.py
@@ -82,7 +82,8 @@
def forward(self, input: torch.Tensor, cache: torch.Tensor):
x = torch.unsqueeze(input, 1)
x_per = x.permute(0, 3, 2, 1) # B D T C
-
+
+ cache = cache.to(x_per.device)
y_left = torch.cat((cache, x_per), dim=2)
cache = y_left[:, :, -(self.lorder - 1) * self.lstride:, :]
y_left = self.conv_left(y_left)
@@ -297,4 +298,4 @@
print('input shape: {}'.format(x.shape))
print('output shape: {}'.format(y.shape))
- print(fsmn.to_kaldi_net())
\ No newline at end of file
+ print(fsmn.to_kaldi_net())
--
Gitblit v1.9.1