Update ops.py

This commit is contained in:
comfyanonymous 2025-12-12 11:37:32 -05:00 committed by GitHub
parent 97eeb4d1c6
commit e140d3d496
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -534,7 +534,7 @@ def mixed_precision_ops(quant_config={}, compute_dtype=torch.bfloat16, full_prec
if dtype != MixedPrecisionOps._compute_dtype:
self.comfy_cast_weights = True
if self._has_bias:
self.bias = torch.nn.Parameter(torch.empty(out_features, device=device, dtype=dtype))
self.bias = torch.nn.Parameter(torch.empty(self.out_features, device=device, dtype=dtype))
else:
self.register_parameter("bias", None)
else:
@ -567,7 +567,7 @@ def mixed_precision_ops(quant_config={}, compute_dtype=torch.bfloat16, full_prec
)
if self._has_bias:
self.bias = torch.nn.Parameter(torch.empty(out_features, device=device, dtype=MixedPrecisionOps._compute_dtype))
self.bias = torch.nn.Parameter(torch.empty(self.out_features, device=device, dtype=MixedPrecisionOps._compute_dtype))
else:
self.register_parameter("bias", None)