From d50edc297a7e6d944a244a84adf68b8bcce5a057 Mon Sep 17 00:00:00 2001
From: nsdou <168500039+nsdou@users.noreply.github.com>
Date: 星期三, 15 五月 2024 17:48:37 +0800
Subject: [PATCH] Fix incorrect assignment of 'end' attribute to 'start' in sentences list comprehension (#1680)
---
funasr/models/transformer/utils/dynamic_conv.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/funasr/models/transformer/utils/dynamic_conv.py b/funasr/models/transformer/utils/dynamic_conv.py
index 8a2a0c1..f685038 100644
--- a/funasr/models/transformer/utils/dynamic_conv.py
+++ b/funasr/models/transformer/utils/dynamic_conv.py
@@ -95,9 +95,9 @@
weight_new = torch.zeros(B * H * T * (T + k - 1), dtype=weight.dtype)
weight_new = weight_new.view(B, H, T, T + k - 1).fill_(float("-inf"))
weight_new = weight_new.to(x.device) # B x H x T x T+k-1
- weight_new.as_strided(
- (B, H, T, k), ((T + k - 1) * T * H, (T + k - 1) * T, T + k, 1)
- ).copy_(weight)
+ weight_new.as_strided((B, H, T, k), ((T + k - 1) * T * H, (T + k - 1) * T, T + k, 1)).copy_(
+ weight
+ )
weight_new = weight_new.narrow(-1, int((k - 1) / 2), T) # B x H x T x T(k)
if self.use_kernel_mask:
kernel_mask = torch.tril(torch.ones(T, T, device=x.device)).unsqueeze(0)
--
Gitblit v1.9.1