core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order#
Ordered sequence with indexed item lookup.
Module Contents#
Classes#
Insertion order with weakly held items and successor lookup. |
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 weakly held items and successor lookup.
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 live items in order.
- next_item( ) core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T | None#
Return the live item that follows
item, if any.