Skip to content

Commit a756f6e

Browse files
committed
Fix ConstUnpack for 0-dim numpy arrays
1 parent c0f5ae1 commit a756f6e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Deeploy/DeeployTypes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,9 @@ def _constUnpack(value: Any) -> Any:
10971097
return value.values.tolist()
10981098
elif isinstance(value, np.ndarray):
10991099
return value.tolist()
1100+
# LMACAN: hacky way to detect a 0-dim numpy array
1101+
elif hasattr(value, "ndim") and value.ndim == 0 and hasattr(value, "item"):
1102+
return value.item()
11001103
else:
11011104
return value
11021105

0 commit comments

Comments
 (0)