From fbba712887e54adc1a8e6eb6cebf2bcd72f27b4c Mon Sep 17 00:00:00 2001 From: Zengwei Yao Date: Sat, 12 Oct 2024 19:09:05 +0800 Subject: [PATCH] Fix issue with eval mode in ActivationDropoutLinear (#1770) * Fix issue with eval mode in ActivationDropoutLinear --------- Co-authored-by: Daniel Povey --- egs/librispeech/ASR/zipformer/scaling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/librispeech/ASR/zipformer/scaling.py b/egs/librispeech/ASR/zipformer/scaling.py index 2a40b8d643..d345c29316 100644 --- a/egs/librispeech/ASR/zipformer/scaling.py +++ b/egs/librispeech/ASR/zipformer/scaling.py @@ -1635,7 +1635,7 @@ def __init__( self.dropout_shared_dim = dropout_shared_dim def forward(self, x: Tensor): - if torch.jit.is_scripting() or torch.jit.is_tracing(): + if not self.training or torch.jit.is_scripting() or torch.jit.is_tracing(): if self.activation == "SwooshL": x = SwooshLForward(x) elif self.activation == "SwooshR":