Skip to content

Commit b7ed4ae

Browse files
committed
Handle modulelist in hashing
1 parent 3555f40 commit b7ed4ae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gbmi/utils/hashing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ def _json_default(
143143
exclude_filter=exclude_filter,
144144
dictify_by_default=dictify_by_default,
145145
)
146+
elif isinstance(thing, torch.nn.modules.container.ModuleList):
147+
return _json_dumps(
148+
[module for module in thing],
149+
exclude_filter=exclude_filter,
150+
dictify_by_default=dictify_by_default,
151+
)
146152
elif isinstance(thing, type):
147153
return f"{thing.__module__}.{thing.__name__}"
148154
elif (

0 commit comments

Comments
 (0)