Skip to content

Commit

Permalink
Fix stack() for non-Tensor types
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Nov 24, 2023
1 parent b3ea4a2 commit d1eace7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phiml/math/_magic_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def stack(values: Union[tuple, list, dict], dim: Union[Shape, str], expand_value
if not dim:
assert len(values) == 1, f"Only one element can be passed as `values` if no dim is passed but got {values}"
from ._tensors import wrap
return wrap(next(iter(values.values())) if isinstance(values, dict) else values[0])
return next(iter(values.values())) if isinstance(values, dict) else values[0] # this may not be wrappable
if not isinstance(dim, Shape):
dim = auto(dim)
values_ = tuple(values.values()) if isinstance(values, dict) else values
Expand Down

0 comments on commit d1eace7

Please sign in to comment.