#  tests for faiss-gpu-1.5.3-py36h1a5d453_0 (this is a generated file);
print('===== testing package: faiss-gpu-1.5.3-py36h1a5d453_0 =====');
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.3-py36h1a5d453_0 OK =====');
