Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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