MCPcopy Index your code
hub / github.com/huggingface/diffusers / pin_memory

Method pin_memory

src/diffusers/training_utils.py:781–787  ·  view source on GitHub ↗

r""" Move internal buffers of the ExponentialMovingAverage to pinned memory. Useful for non-blocking transfers for offloading EMA params to the host.

(self)

Source from the content-addressed store, hash-verified

779 param.data.copy_(s_param.to(param.device).data)
780
781 def pin_memory(self) -> None:
782 r"""
783 Move internal buffers of the ExponentialMovingAverage to pinned memory. Useful for non-blocking transfers for
784 offloading EMA params to the host.
785 """
786
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"""

Callers 5

mainFunction · 0.95
_to_cpuMethod · 0.80
_onload_from_diskMethod · 0.80
load_model_hookFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected