mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-08 09:32:20 +00:00
Fix logging torch.dtype. (#1947)
This commit is contained in:
parent
e79833aad2
commit
fd8f8780fa
@ -186,7 +186,7 @@ class AttributeDict(dict):
|
||||
tmp = {}
|
||||
for k, v in self.items():
|
||||
# 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)
|
||||
tmp[k] = v
|
||||
return json.dumps(tmp, indent=indent, sort_keys=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user