mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Revert making the dropout of pos_emb independent across the batch.
This commit is contained in:
parent
804917837e
commit
ce4b50d094
@ -984,8 +984,7 @@ class RelPositionalEncoding(torch.nn.Module):
|
||||
+ x.size(0),
|
||||
:
|
||||
]
|
||||
batch_size = x.size(1)
|
||||
pos_emb = pos_emb.unsqueeze(0).expand(batch_size, -1, -1) # now: (batch_size, 2*time-1, embed_dim)
|
||||
pos_emb = pos_emb.unsqueeze(0)
|
||||
return self.dropout(pos_emb)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user