Skip to content

Commit cecd8d3

Browse files
authored
Comment explaining a decision (#6531)
1 parent b73e564 commit cecd8d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def type_for_tensor(self, name: str, tensor: LazyTensor) -> DataType:
139139
dt = GGML_FILE_TYPE_TO_DATA_TYPE.get(self)
140140
if dt is None:
141141
raise ValueError(self)
142-
# 1D tensors are always F32.
142+
# Convert all 1D tensors to F32. Most of the codebase that takes in 1D tensors only handles F32 tensors, and most of the outputs tensors are F32.
143+
# Also The 1d tensors aren't much of a performance/size issue. So instead of having to have separate F32 and F16 implementations of both, just convert everything to F32 for now.
143144
return dt if len(tensor.shape) > 1 else DT_F32
144145

145146

0 commit comments

Comments
 (0)