Skip to content

Instantly share code, notes, and snippets.

@mdouze
Created July 19, 2017 08:36
Show Gist options
  • Save mdouze/d82fa89eb47e2ea8fd841e5454d71b88 to your computer and use it in GitHub Desktop.
Save mdouze/d82fa89eb47e2ea8fd841e5454d71b88 to your computer and use it in GitHub Desktop.
diff --git a/faiss/swigfaiss.swig b/faiss/swigfaiss.swig
--- a/faiss/swigfaiss.swig
+++ b/faiss/swigfaiss.swig
@@ -548,6 +548,10 @@
return NULL;
}
+float * cast_integer_to_float_ptr (long x) {
+ return (float*)x;
+}
+
%}
@@ -576,6 +580,8 @@
REV_SWIG_PTR(int, NPY_INT32);
REV_SWIG_PTR(unsigned char, NPY_UINT8);
+float * cast_integer_to_float_ptr (long x);
+
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment