MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / state_dict

Method state_dict

diffusers/src/diffusers/training_utils.py:510–527  ·  view source on GitHub ↗

r""" Returns the state of the ExponentialMovingAverage as a dict. This method is used by accelerate during checkpointing to save the ema state dict.

(self)

Source from the content-addressed store, hash-verified

508 ]
509
510 def state_dict(self) -> dict:
511 r"""
512 Returns the state of the ExponentialMovingAverage as a dict. This method is used by accelerate during
513 checkpointing to save the ema state dict.
514 """
515 # Following PyTorch conventions, references to tensors are returned:
516 # "returns a reference to the state and not its copy!" -
517 # https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict
518 return {
519 "decay": self.decay,
520 "min_decay": self.min_decay,
521 "optimization_step": self.optimization_step,
522 "update_after_step": self.update_after_step,
523 "use_ema_warmup": self.use_ema_warmup,
524 "inv_gamma": self.inv_gamma,
525 "power": self.power,
526 "shadow_params": self.shadow_params,
527 }
528
529 def store(self, parameters: Iterable[torch.nn.Parameter]) -> None:
530 r"""

Callers 15

save_pretrainedMethod · 0.95
load_model_hookFunction · 0.45
unet_lora_state_dictFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
unetFunction · 0.45
value_functionFunction · 0.45
mainFunction · 0.45
convert_safety_checkerFunction · 0.45
get_super_res_unetFunction · 0.45

Calls

no outgoing calls