Unverified Commit 6ace2f72 authored by Huy Do's avatar Huy Do Committed by GitHub
Browse files

Fix writing benchmark results with tuple keys (#23633)


Signed-off-by: default avatarHuy Do <huydhn@gmail.com>
parent b00e69f8
......@@ -54,7 +54,12 @@ class InfEncoder(json.JSONEncoder):
def clear_inf(self, o: Any):
if isinstance(o, dict):
return {k: self.clear_inf(v) for k, v in o.items()}
return {
str(k)
if not isinstance(k, (str, int, float, bool, type(None)))
else k: self.clear_inf(v)
for k, v in o.items()
}
elif isinstance(o, list):
return [self.clear_inf(v) for v in o]
elif isinstance(o, float) and math.isinf(o):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment