Fix wrong weight reference in dynamic EPLB (#6818)

This commit is contained in:
fzyzcjy
2025-06-02 23:26:04 -07:00
committed by GitHub
parent 27e327b415
commit 0ea330ca34
3 changed files with 27 additions and 13 deletions
+13
View File
@@ -2257,3 +2257,16 @@ except:
def cpu_has_amx_support():
return torch._C._cpu._is_amx_tile_supported() and is_intel_amx_backend_available
class LazyValue:
def __init__(self, creator: Callable):
self._creator = creator
self._value = None
@property
def value(self):
if self._creator is not None:
self._value = self._creator()
self._creator = None
return self._value