Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions dataclass_array/array_dataclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,11 +1122,9 @@ def inner_shape(self) -> Shape:
"""Returns the the static shape resolved for the current value."""
# torch.func.vmap calls `tree_unflatten([0] * num_leaves)` internally,
# messing up shape inference.
if (
enp.lazy.has_torch
and isinstance(self.value, int)
and self.value == 0
):
if not self.full_shape and self.inner_shape_non_static:
if enp.lazy.has_torch:
return ()
return ()
if not self.inner_shape_non_static:
return ()
Expand Down
Loading