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 resource | |
import numpy as np | |
from scipy import weave | |
x = np.ones(1e6, dtype=np.float32) | |
# There is no memory leak, when we let PyArray_CumSum creates the output array, i.e. when out=NULL. | |
code_good = r""" | |
npy_intp shape[1] = { PyArray_SIZE(x_array) }; | |
int dtype = PyArray_DTYPE(x_array)->type_num; |
NewerOlder