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

Method rebuild_parameter

lit_gpt/utils_old.py:116–126  ·  view source on GitHub ↗
(cls, data, requires_grad, backward_hooks, *, archiveinfo=None)

Source from the content-addressed store, hash-verified

114
115 @classmethod
116 def rebuild_parameter(cls, data, requires_grad, backward_hooks, *, archiveinfo=None):
117 if isinstance(data, NotYetLoadedTensor):
118 old_lt = data._load_tensor
119
120 def _load_tensor():
121 t = old_lt()
122 return torch._utils._rebuild_parameter(t, requires_grad, backward_hooks)
123
124 data._load_tensor = _load_tensor
125 return data
126 return torch._utils._rebuild_parameter(data, requires_grad, backward_hooks)
127
128 @classmethod
129 def rebuild_tensor_v2(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected