mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 01:52:41 +00:00
Fix logging torch.dtype.
This commit is contained in:
parent
e79833aad2
commit
2ca458bb56
@ -186,7 +186,7 @@ class AttributeDict(dict):
|
|||||||
tmp = {}
|
tmp = {}
|
||||||
for k, v in self.items():
|
for k, v in self.items():
|
||||||
# PosixPath is ont JSON serializable
|
# PosixPath is ont JSON serializable
|
||||||
if isinstance(v, pathlib.Path) or isinstance(v, torch.device):
|
if isinstance(v, (pathlib.Path, torch.device, torch.dtype)):
|
||||||
v = str(v)
|
v = str(v)
|
||||||
tmp[k] = v
|
tmp[k] = v
|
||||||
return json.dumps(tmp, indent=indent, sort_keys=True)
|
return json.dumps(tmp, indent=indent, sort_keys=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user