mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 10:02:22 +00:00
Fix issue with eval mode in ActivationDropoutLinear (#1770)
* Fix issue with eval mode in ActivationDropoutLinear --------- Co-authored-by: Daniel Povey <dpovey@gmail.com>
This commit is contained in:
parent
d9844d847f
commit
fbba712887
@ -1635,7 +1635,7 @@ class ActivationDropoutAndLinear(torch.nn.Module):
|
|||||||
self.dropout_shared_dim = dropout_shared_dim
|
self.dropout_shared_dim = dropout_shared_dim
|
||||||
|
|
||||||
def forward(self, x: Tensor):
|
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":
|
if self.activation == "SwooshL":
|
||||||
x = SwooshLForward(x)
|
x = SwooshLForward(x)
|
||||||
elif self.activation == "SwooshR":
|
elif self.activation == "SwooshR":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user