#  tests for faiss-gpu-1.5.2-py36h32c130d_1 (this is a generated file);
print('===== testing package: faiss-gpu-1.5.2-py36h32c130d_1 =====');
print('running run_test.py');
#  --- run_test.py (begin) ---
import faiss
import numpy as np

d = 128
n = 100

rs = np.random.RandomState(1337)
x = rs.rand(n, d).astype(np.float32)

index = faiss.IndexFlatL2(d)

res = faiss.StandardGpuResources()
gpu_index = faiss.index_cpu_to_gpu(res, 0, index)
gpu_index.add(x)

D, I = index.search(x, 10)
#  --- run_test.py (end) ---

print('===== faiss-gpu-1.5.2-py36h32c130d_1 OK =====');
