Skip to content

Instantly share code, notes, and snippets.

View manodeep's full-sized avatar
👋

Manodeep Sinha manodeep

👋
View GitHub Profile
@manodeep
manodeep / Timings.py
Last active August 10, 2023 04:11 — forked from synapticarbors/Timings.py
Attempt to create a faster version of a Euclidean pairwise distance method in cython using BLAS. Strategy for including BLAS taken from the Tokyo project.
import numpy as np
from scipy.spatial.distance import cdist
from distlib import pairwise_cython_blas, pairwise_cython, pairwise_cython_blas2
import timeit
a = np.random.random(size=(10000,3))
loop = 1
repeat = 1
funcs = ['cdist(a,a)', 'pairwise_cython(a)', 'pairwise_cython_blas(a)', 'pairwise_cython_blas2(a)']