Skip to content

Commit a5dbd21

Browse files
ConchylicultorThe dataclass_array Authors
authored andcommitted
Add spec_like support to dataclass_array
PiperOrigin-RevId: 592844806
1 parent e97a78b commit a5dbd21

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ To release a new version (e.g. from `1.0.0` -> `2.0.0`):
2323

2424
## [Unreleased]
2525

26+
* Fix `etree.spec_like` support
27+
2628
## [1.5.1] - 2023-08-30
2729

2830
* Fix look_at compatibility with pytorch

dataclass_array/array_dataclass.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,9 @@ def is_value_missing(self) -> bool:
11031103
# In `jax/_src/api_util.py` for `flatten_axes`, jax set all values to a
11041104
# dummy sentinel `object()` value.
11051105
return True
1106+
elif isinstance(self.value, enp.ArraySpec):
1107+
# `etree.spec_like` compatibility
1108+
return True
11061109
elif (
11071110
isinstance(self.value, DataclassArray) and not self.value._array_fields # pylint: disable=protected-access
11081111
):

0 commit comments

Comments
 (0)