MCPcopy Create free account
hub / github.com/ace-step/ACE-Step / __enter__

Method __enter__

acestep/cpu_offload.py:12–15  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

10 self.original_dtype = model.dtype
11
12 def __enter__(self):
13 if not hasattr(self.model,"torchao_quantized"):
14 self.model.to(self.original_device, dtype=self.original_dtype)
15 return self.model
16
17 def __exit__(self, *args):
18 if not hasattr(self.model,"torchao_quantized"):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected