From a35b28cd8d43de40337d8b8bf347bd98fba6e02d Mon Sep 17 00:00:00 2001 From: yaozengwei Date: Tue, 19 Jul 2022 14:29:23 +0800 Subject: [PATCH] fix for case of None stats --- icefall/diagnostics.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/icefall/diagnostics.py b/icefall/diagnostics.py index 4850308d91..2e6087ad5b 100644 --- a/icefall/diagnostics.py +++ b/icefall/diagnostics.py @@ -178,6 +178,9 @@ def accumulate(self, x): def print_diagnostics(self): """Print diagnostics for each dimension of the tensor.""" + if self.stats is None: + print(f"Warning: the stats of {self.name} is None.") + return for dim, this_dim_stats in enumerate(self.stats): for stats_type, stats_list in this_dim_stats.items(): # stats_type could be "rms", "value", "abs", "eigs", "positive".