Created
January 14, 2021 18:15
-
-
Save rvaghefi/0a387d89a6eac731d730232bed5fd26c to your computer and use it in GitHub Desktop.
numba_for_loop.py
This file contains 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
from numba import jit | |
@jit(nopython=True) | |
def numba_for_loop(X,Y): | |
m = X.shape[0] | |
k = Y.shape[0] | |
D = np.zeros((m,k)) | |
for i in range(m): | |
for j in range(k): | |
D[i,j] = np.sum((X[i] - Y[j])**2)**0.5 | |
return D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment