From d80ac2fd2df4e7fb8a28acfa512bb11472b5cc99 Mon Sep 17 00:00:00 2001 From: liugz18 <57401541+liugz18@users.noreply.github.com> Date: 星期四, 18 七月 2024 21:34:55 +0800 Subject: [PATCH] Rename 'res' in line 514 to avoid with naming conflict with line 365 --- funasr/models/transformer/positionwise_feed_forward.py | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/funasr/models/transformer/positionwise_feed_forward.py b/funasr/models/transformer/positionwise_feed_forward.py index 081ff5b..7cfa5f9 100644 --- a/funasr/models/transformer/positionwise_feed_forward.py +++ b/funasr/models/transformer/positionwise_feed_forward.py @@ -35,15 +35,14 @@ class PositionwiseFeedForwardDecoderSANMExport(torch.nn.Module): - def __init__(self, model): - super().__init__() - self.w_1 = model.w_1 - self.w_2 = model.w_2 - self.activation = model.activation - self.norm = model.norm - - def forward(self, x): - x = self.activation(self.w_1(x)) - x = self.w_2(self.norm(x)) - return x + def __init__(self, model): + super().__init__() + self.w_1 = model.w_1 + self.w_2 = model.w_2 + self.activation = model.activation + self.norm = model.norm + def forward(self, x): + x = self.activation(self.w_1(x)) + x = self.w_2(self.norm(x)) + return x -- Gitblit v1.9.1