Fix issue with diagnostics if stats is None

This commit is contained in:
Daniel Povey 2022-10-11 11:04:40 +08:00
parent 569762397f
commit 1825336841

View File

@ -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]