Python class
NestedIterableDataclass
NestedIterableDataclass
class max.nn.kv_cache.NestedIterableDataclass
Bases: Generic[T]
Base class for input symbols for KV cache managers.
The derived class is responsible for defining the input symbols for the specific KV cache manager. For example, here’s a derived class for a text KV cache manager:
@dataclass
class PagedCacheValues(NestedIterableDataclass[TensorType]):
kv_blocks: TensorType
cache_lengths: TensorType
lookup_table: TensorType
max_lengths: TensorTypeflatten()
flatten()
Returns all leaf values as a flat list.
-
Returns:
-
A list containing every non-
Noneleaf value yielded by iterating this dataclass. -
Return type:
-
list[T]
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!