L i%`ddlmZmZddlmZmZddgZeGddeZedeZy))AnyTypeVar)Protocolruntime_checkableStateful StatefulTc@eZdZdZdeeeffdZdeeefddfdZy)rzN Stateful protocol for objects that can be checkpointed and restored. returncy)a Objects should return their state_dict representation as a dictionary. The output of this function will be checkpointed, and later restored in `load_state_dict()`. .. warning:: Because of the inplace nature of restoring a checkpoint, this function is also called during `torch.distributed.checkpoint.load`. Returns: Dict: The objects state dict N)selfs k/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/distributed/checkpoint/stateful.py state_dictzStateful.state_dicts rNcy)z Restore the object's state from the provided state_dict. Args: state_dict: The state dict to restore from Nr )r rs rload_state_dictzStateful.load_state_dicts r) __name__ __module__ __qualname____doc__dictstrrrrr rrrrs6 DcN " $sCx. T r)boundN) typingrrtyping_extensionsrr__all__rrr rrrsA9 { # x  B Kx 0 r