mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-24 07:08:45 +00:00
fix repr when there are non-Fluxion modules in a tree
This commit is contained in:
parent
b4ee65b9b1
commit
928da1ee1c
|
@ -358,7 +358,10 @@ class ModuleTree:
|
|||
|
||||
node: TreeNode = {"value": value, "class_name": class_name, "children": []}
|
||||
for child in module.children():
|
||||
node["children"].append(self._module_to_tree(module=child)) # type: ignore
|
||||
if isinstance(child, Module):
|
||||
node["children"].append(self._module_to_tree(module=child))
|
||||
else:
|
||||
node["children"].append({"value": str(child), "class_name": child.__class__.__name__, "children": []})
|
||||
return node
|
||||
|
||||
def _fold_successive_identical(self, node: TreeNode) -> None:
|
||||
|
|
Loading…
Reference in a new issue