From e84f525840a24ceb9d5db3a14ef2d43d226190ae Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Fri, 16 Dec 2022 12:24:54 +0800 Subject: [PATCH] Fix test condition --- egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py b/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py index dfb9822cd..ac8e5c19d 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py @@ -1730,7 +1730,7 @@ class ConvNeXt(nn.Module): The returned value has the same shape as x. """ - if (not self.training) or torch.jit.is_scripting() or random.random() < float(self.layerdrop_prob): + if torch.jit.is_scripting() or (self.training and random.random() < float(self.layerdrop_prob)): return x bypass = x