From 4d5c1f2e60317bc27a791982eb7e1fcb3603385d Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Mon, 10 Jun 2024 22:41:54 +0800 Subject: [PATCH] Remove inf from stored stats (#1647) --- icefall/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/icefall/utils.py b/icefall/utils.py index 0c509fc174..1dbb954ded 100644 --- a/icefall/utils.py +++ b/icefall/utils.py @@ -1159,7 +1159,8 @@ def __add__(self, other: "MetricsTracker") -> "MetricsTracker": for k, v in self.items(): ans[k] = v for k, v in other.items(): - ans[k] = ans[k] + v + if v - v == 0: + ans[k] = ans[k] + v return ans def __mul__(self, alpha: float) -> "MetricsTracker":