Don't crash right away if op is uninitialized. (#12615)

This commit is contained in:
comfyanonymous
2026-02-24 09:28:25 -08:00
committed by GitHub
parent 11fefa58e9
commit 599f9c5010

View File

@@ -827,6 +827,10 @@ def mixed_precision_ops(quant_config={}, compute_dtype=torch.bfloat16, full_prec
else:
sd = {}
if not hasattr(self, 'weight'):
logging.warning("Warning: state dict on uninitialized op {}".format(prefix))
return sd
if self.bias is not None:
sd["{}bias".format(prefix)] = self.bias