mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 10:02:22 +00:00
Fix RE identity
This commit is contained in:
parent
709c387ce6
commit
f87811e65c
@ -83,7 +83,7 @@ class Conformer(EncoderInterface):
|
||||
aux_layers=list(range(0, num_encoder_layers-1, aux_layer_period)))
|
||||
|
||||
if output_dim == d_model:
|
||||
self.encoder_output_layer = Identity()
|
||||
self.encoder_output_layer = nn.Identity()
|
||||
else:
|
||||
self.encoder_output_layer = ScaledLinear(d_model, output_dim,
|
||||
initial_speed=0.5)
|
||||
@ -936,10 +936,6 @@ class ConvolutionModule(nn.Module):
|
||||
return x.permute(2, 0, 1)
|
||||
|
||||
|
||||
class Identity(torch.nn.Module):
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
return x
|
||||
|
||||
|
||||
class Conv2dSubsampling(nn.Module):
|
||||
"""Convolutional 2D subsampling (to 1/4 length).
|
||||
|
Loading…
x
Reference in New Issue
Block a user