Bug fix for faiss_Index_sa_code_size (#4492)

Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4492

The C api has a bug where we don't set the size in this method. The CPP api sets it correctly https://www.internalfb.com/code/fbsource/[630a7e128132fa049cea4b73d9d9eb079e0608d6]/fbcode/assistant/knowledge/search/external/faiss/faiss_c_api.cpp?lines=164

Created from CodeHub with https://fburl.com/edit-in-codehub

Differential Revision: D79453787

fbshipit-source-id: 287916f83b35e501c3e293005d9cbea054a7475c
This commit is contained in:
Octavian Guzu
2025-08-04 03:09:34 -07:00
committed by Facebook GitHub Bot
parent 580f2f9246
commit 6b09e99709
+1 -1
View File
@@ -195,7 +195,7 @@ int faiss_Index_compute_residual_n(
int faiss_Index_sa_code_size(const FaissIndex* index, size_t* size) {
try {
reinterpret_cast<const faiss::Index*>(index)->sa_code_size();
*size = reinterpret_cast<const faiss::Index*>(index)->sa_code_size();
}
CATCH_AND_HANDLE
}