This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################### | |
| # serialization of indexes to byte arrays | |
| ########################################### | |
| def serialize_index(index): | |
| """ convert an index to a numpy uint8 array """ | |
| writer = faiss.VectorIOWriter() | |
| faiss.write_index(index, writer) | |
| return faiss.vector_to_array(writer.data) |
OlderNewer