From 1135669e93c318ba787f5803a296118b4704bb09 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Sun, 16 Oct 2022 10:58:22 +0800 Subject: [PATCH] Bug fix RE float16 --- egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py b/egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py index fe8867291..5866ee517 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py @@ -572,7 +572,7 @@ class Whiten(nn.Module): if hasattr(self, 'min_prob') and random.random() < 0.25: # occasionally switch between min_prob and max_prob, based on whether # we are above or below the threshold. - if _whitening_metric(x, self.num_groups) > self.whitening_limit: + if _whitening_metric(x.to(torch.float32), self.num_groups) > self.whitening_limit: # there would be a change to the grad. self.prob = self.max_prob else: