mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Fix bug RE self.training
This commit is contained in:
parent
81542832bf
commit
61f62837fa
@ -348,7 +348,7 @@ class ConformerEncoder(nn.Module):
|
|||||||
def get_random_mask():
|
def get_random_mask():
|
||||||
# 1.0 means don't drop the layer, 0.0 means drop the layer
|
# 1.0 means don't drop the layer, 0.0 means drop the layer
|
||||||
mask = torch.ones(num_layers, device='cpu')
|
mask = torch.ones(num_layers, device='cpu')
|
||||||
if self.training:
|
if not self.training:
|
||||||
return mask
|
return mask
|
||||||
r = rng.random()
|
r = rng.random()
|
||||||
if r < 0.1:
|
if r < 0.1:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user