Skip to content

Commit

Permalink
fix for case of None stats
Browse files Browse the repository at this point in the history
  • Loading branch information
yaozengwei committed Jul 19, 2022
1 parent 74c14f5 commit a35b28c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions icefall/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down

0 comments on commit a35b28c

Please sign in to comment.