[Minor] Fix bias in if to remove ambiguity (#3259)

This commit is contained in:
Hui Liu
2024-03-13 09:16:55 -07:00
committed by GitHub
parent e221910e77
commit ba8dc958a3

View File

@ -73,7 +73,7 @@ class UnquantizedLinearMethod(LinearMethodBase):
bias: Optional[torch.Tensor] = None) -> torch.Tensor:
weight = weights["weight"]
if self.separate_bias_add:
if bias:
if bias is not None:
return F.linear(x, weight) + bias
return F.linear(x, weight)
return F.linear(x, weight, bias)