Last active
November 8, 2018 04:42
-
-
Save chelseatroy/0a926662362791b0db67264bf0bd6a2b to your computer and use it in GitHub Desktop.
Naive Cython Implementation
This file contains hidden or 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
import numpy as np | |
def cython_multiplication(double[:,:] a, double[:,:] b, double[:,:] out, int x_dims, int y_dims): | |
cdef int i, j | |
for i in range(x_dims): | |
for j in range(y_dims): | |
out[i, j] = a[i,j] * b[i,j] | |
return np.asarray(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment