Commit 5eb8850 1 parent fc02fe9 commit 5eb8850 Copy full SHA for 5eb8850
File tree 2 files changed +4
-4
lines changed
rust/lance-index/src/vector/ivf
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ message IVF {
68
68
Tensor centroids_tensor = 4 ;
69
69
70
70
// KMeans loss.
71
- double loss = 5 ;
71
+ optional double loss = 5 ;
72
72
}
73
73
74
74
// Product Quantization.
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ impl TryFrom<&IvfModel> for PbIvf {
180
180
lengths,
181
181
offsets : ivf. offsets . iter ( ) . map ( |x| * x as u64 ) . collect ( ) ,
182
182
centroids_tensor : ivf. centroids . as_ref ( ) . map ( |c| c. try_into ( ) ) . transpose ( ) ?,
183
- loss : ivf. loss . unwrap_or_default ( ) ,
183
+ loss : ivf. loss ,
184
184
} )
185
185
}
186
186
}
@@ -229,7 +229,7 @@ impl TryFrom<PbIvf> for IvfModel {
229
229
centroids,
230
230
offsets,
231
231
lengths : proto. lengths ,
232
- loss : Some ( proto. loss ) ,
232
+ loss : proto. loss ,
233
233
} )
234
234
}
235
235
}
@@ -311,7 +311,7 @@ mod tests {
311
311
lengths : vec ! [ 2 , 2 ] ,
312
312
offsets : vec ! [ 0 , 2 ] ,
313
313
centroids_tensor : None ,
314
- loss : 0.0 ,
314
+ loss : None ,
315
315
} ;
316
316
317
317
let ivf = IvfModel :: try_from ( pb_ivf) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments