Fix dequant_dtype handling (#334)

* Fix dequant_dtype handling

* Simplify dequant dtype selection expression
This commit is contained in:
blepping
2025-09-14 23:10:50 +02:00
committed by GitHub
parent 6b778afdc9
commit be2a08330d
+1 -1
View File
@@ -153,7 +153,7 @@ class GGMLLayer(torch.nn.Module):
# Take into account space required for dequantizing the largest tensor
if self.largest_layer:
shape = getattr(self.weight, "tensor_shape", self.weight.shape)
dtype = (self.dequant_dtype and self.dequant_dtype != "target") or torch.float16
dtype = self.dequant_dtype if self.dequant_dtype and self.dequant_dtype != "target" else torch.float16
temp = torch.empty(*shape, device=torch.device("meta"), dtype=dtype)
destination[prefix + "temp.weight"] = temp