MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / find_class

Method find_class

lit_gpt/utils_old.py:199–207  ·  view source on GitHub ↗
(self, module, name)

Source from the content-addressed store, hash-verified

197 self.zipfile_context = zipfile_context
198
199 def find_class(self, module, name):
200 res = super().find_class(module, name)
201 if module == "torch._utils" and name == "_rebuild_tensor_v2":
202 return partial(NotYetLoadedTensor.rebuild_tensor_v2, archiveinfo=self)
203 if module == "torch._tensor" and name == "_rebuild_from_type_v2":
204 return partial(NotYetLoadedTensor.rebuild_from_type_v2, archiveinfo=self)
205 if module == "torch._utils" and name == "_rebuild_parameter":
206 return partial(NotYetLoadedTensor.rebuild_parameter, archiveinfo=self)
207 return res
208
209 def persistent_load(self, pid):
210 name, cls, fn, device, size = pid

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected