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

Method to

diffusers/src/diffusers/training_utils.py:496–508  ·  view source on GitHub ↗

r"""Move internal buffers of the ExponentialMovingAverage to `device`. Args: device: like `device` argument to `torch.Tensor.to`

(self, device=None, dtype=None, non_blocking=False)

Source from the content-addressed store, hash-verified

494 self.shadow_params = [p.pin_memory() for p in self.shadow_params]
495
496 def to(self, device=None, dtype=None, non_blocking=False) -> None:
497 r"""Move internal buffers of the ExponentialMovingAverage to `device`.
498
499 Args:
500 device: like `device` argument to `torch.Tensor.to`
501 """
502 # .to() on the tensors handles None correctly
503 self.shadow_params = [
504 p.to(device=device, dtype=dtype, non_blocking=non_blocking)
505 if p.is_floating_point()
506 else p.to(device=device, non_blocking=non_blocking)
507 for p in self.shadow_params
508 ]
509
510 def state_dict(self) -> dict:
511 r"""

Callers 15

mainFunction · 0.95
__init__Method · 0.95
__call__Method · 0.45
infer.pyFile · 0.45
collate_fn_oursFunction · 0.45
mainFunction · 0.45
load_model_hookFunction · 0.45
compute_snrFunction · 0.45
cast_training_paramsFunction · 0.45
copy_toMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected