MCPcopy
hub / github.com/KlingAIResearch/ReCamMaster / onload

Method onload

diffsynth/vram_management/layers.py:28–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26 self.state = 0
27
28 def onload(self):
29 if self.state == 0 and (self.offload_dtype != self.onload_dtype or self.offload_device != self.onload_device):
30 self.module.to(dtype=self.onload_dtype, device=self.onload_device)
31 self.state = 1
32
33 def forward(self, *args, **kwargs):
34 if self.onload_dtype == self.computation_dtype and self.onload_device == self.computation_device:

Callers 1

load_models_to_deviceMethod · 0.45

Calls 1

toMethod · 0.45

Tested by

no test coverage detected