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