Skip to content
Snippets Groups Projects
Commit 73a99eec authored by bbauvin's avatar bbauvin
Browse files

Trying to fix segmentation fault

parent 9604c3f5
Branches
Tags
No related merge requests found
......@@ -35,14 +35,14 @@ def getValue(DATASET):
def extractSubset(matrix, usedIndices):
if sparse.issparse(matrix):
newIndptr = np.zeros(len(usedIndices)+1, dtype=np.int16)
newIndptr = np.zeros(len(usedIndices)+1, dtype=int)
oldindptr = matrix.indptr
print oldindptr
for exampleIndexIndex, exampleIndex in enumerate(usedIndices):
newIndptr[exampleIndexIndex+1] = newIndptr[exampleIndexIndex]+(oldindptr[exampleIndex+1]-oldindptr[exampleIndex])
print newIndptr
newData = np.ones(newIndptr[-1], dtype=bool)
newIndices = np.zeros(newIndptr[-1], dtype=np.int32)
newIndices = np.zeros(newIndptr[-1], dtype=int)
oldIndices = matrix.indices
for exampleIndexIndex, exampleIndex in enumerate(usedIndices):
newIndices[newIndptr[exampleIndexIndex]:newIndptr[exampleIndexIndex+1]] = oldIndices[oldindptr[exampleIndex]: oldindptr[exampleIndex+1]]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment