Skip to content

Commit

Permalink
Fix math.save() for nested tuples/lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Holl committed Nov 4, 2024
1 parent 3b6d27d commit daa6fbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phiml/math/_tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2900,7 +2900,7 @@ def save(file: str, obj):
all_natives = sum(natives, ())
all_paths = sum(native_paths, [])
all_np = [choose_backend(n).numpy(n) for n in all_natives]
np.savez(file, tree=tree, specs=specs, paths=paths, **{p: n for p, n in zip(all_paths, all_np)})
np.savez(file, tree=np.asarray(tree, dtype=object), specs=specs, paths=paths, **{p: n for p, n in zip(all_paths, all_np)})


def load(file: str):
Expand Down

0 comments on commit daa6fbe

Please sign in to comment.