mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 01:52:41 +00:00
fix issue in zipformer.py (#1566)
This commit is contained in:
parent
bddc3fca7a
commit
353469182c
@ -788,7 +788,7 @@ class Zipformer2EncoderLayer(nn.Module):
|
|||||||
selected_attn_weights = attn_weights[0:1]
|
selected_attn_weights = attn_weights[0:1]
|
||||||
if torch.jit.is_scripting() or torch.jit.is_tracing():
|
if torch.jit.is_scripting() or torch.jit.is_tracing():
|
||||||
pass
|
pass
|
||||||
elif not self.training and random.random() < float(self.const_attention_rate):
|
elif self.training and random.random() < float(self.const_attention_rate):
|
||||||
# Make attention weights constant. The intention is to
|
# Make attention weights constant. The intention is to
|
||||||
# encourage these modules to do something similar to an
|
# encourage these modules to do something similar to an
|
||||||
# averaging-over-time operation.
|
# averaging-over-time operation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user