Skip to content

Instantly share code, notes, and snippets.

@chelseatroy
Last active November 8, 2018 04:42
Show Gist options
  • Save chelseatroy/0a926662362791b0db67264bf0bd6a2b to your computer and use it in GitHub Desktop.
Save chelseatroy/0a926662362791b0db67264bf0bd6a2b to your computer and use it in GitHub Desktop.
Naive Cython Implementation
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