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

Method pin_memory

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

486 param.data.copy_(s_param.to(param.device).data)
487
488 def pin_memory(self) -> None:
489 r"""
490 Move internal buffers of the ExponentialMovingAverage to pinned memory. Useful for non-blocking transfers for
491 offloading EMA params to the host.
492 """
493
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`.

Callers 2

mainFunction · 0.95
load_model_hookFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected