mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Bug-fix RE random shift
This commit is contained in:
parent
f7c99ed1d1
commit
0601dd72fd
@ -978,7 +978,7 @@ class CompactRelPositionalEncoding(torch.nn.Module):
|
||||
|
||||
"""
|
||||
|
||||
shift = 0 if self.training else int(round(random.normalvariate(0, 1) * float(self.random_shift)))
|
||||
shift = int(round(random.normalvariate(0, 1) * float(self.random_shift))) if self.training else 0
|
||||
self.extend_pe(x, shift)
|
||||
|
||||
pos_emb = self.pe[
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user