kups.core.data.batched
¶
Batched
¶
Mixin that validates consistent leading batch dimension across pytree leaves.
Source code in src/kups/core/data/batched.py
size
property
¶
The batch size (same as len()).
Returns:
| Type | Description |
|---|---|
int
|
The size of the batch dimension across all arrays |
__len__()
¶
Return the batch size (leading dimension size).
Returns:
| Type | Description |
|---|---|
int
|
The size of the batch dimension across all arrays |
__post_init__()
¶
Validate that all array leaves share the same leading dimension.
Raises:
| Type | Description |
|---|---|
ValueError
|
If arrays have inconsistent or missing leading dimensions. |
Source code in src/kups/core/data/batched.py
Sliceable
¶
Bases: Batched
Batched dataclass with .at slicing and __getitem__ support.
Provides lens-based .at(index) for get/set and direct indexing
via self[index].