core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order#
Ordered sequence with indexed item lookup.
Module Contents#
Classes#
Insertion order with constant-time successor lookup by item. |
Data#
API#
- core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T#
‘TypeVar(…)’
- class core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.IndexedOrder#
Bases:
typing.Generic[core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T]Insertion order with constant-time successor lookup by item.
Initialization
Create an empty indexed order.
- append( ) None#
Append
itemto the order.- Parameters:
item – Item to append.
- Raises:
ValueError – If
itemis already present in the order.
- __iter__() collections.abc.Iterator[core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T]#
Iterate over items in order.
- next_item( ) core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T | None#
Return the item that follows
item, if any.