MCPcopy
hub / github.com/huggingface/diffusers / to

Method to

src/diffusers/training_utils.py:789–802  ·  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

787 self.shadow_params = [p.pin_memory() for p in self.shadow_params]
788
789 def to(self, device=None, dtype=None, non_blocking=False) -> None:
790 r"""
791 Move internal buffers of the ExponentialMovingAverage to `device`.
792
793 Args:
794 device: like `device` argument to `torch.Tensor.to`
795 """
796 # .to() on the tensors handles None correctly
797 self.shadow_params = [
798 p.to(device=device, dtype=dtype, non_blocking=non_blocking)
799 if p.is_floating_point()
800 else p.to(device=device, non_blocking=non_blocking)
801 for p in self.shadow_params
802 ]
803
804 def state_dict(self) -> dict:
805 r"""

Callers 15

__init__Method · 0.95
compute_snrFunction · 0.45
cast_training_paramsFunction · 0.45
offload_modelsFunction · 0.45
copy_toMethod · 0.45
rgblike_to_depthmapMethod · 0.45
mainFunction · 0.45
extract_loraFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected