Fix inf issue

This commit is contained in:
Daniel Povey 2022-06-10 11:20:47 +08:00
parent 950cd4a3e8
commit c92d9d72aa

View File

@ -901,6 +901,7 @@ class Decorrelate(torch.nn.Module):
if random.random() > apply_prob:
return x
with torch.cuda.amp.autocast(enabled=False):
x = x.to(torch.float32)
ans = DecorrelateFunction.apply(x, self.cov.clone(),
self.scale, self.eps, self.beta,
self.channel_dim) # == x.