From 1825336841840b697782292801b3aa8adbad23df Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Tue, 11 Oct 2022 11:04:40 +0800 Subject: [PATCH] Fix issue with diagnostics if stats is None --- icefall/diagnostics.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/icefall/diagnostics.py b/icefall/diagnostics.py index 9d2ea46c9..c26e37de4 100644 --- a/icefall/diagnostics.py +++ b/icefall/diagnostics.py @@ -278,6 +278,8 @@ class TensorDiagnostic(object): """ combined_name = _summarize_two_names(self.name, other.name) # e.g. combined_name == 'foo.{param_value,param_grad}' or just 'foo.param_value' if self.name == other.name. + if self.stats is None: + return for dim, this_dim_stats in enumerate(self.stats): try: other_dim_stats = other.stats[dim]