Skip to content

Commit 21817d5

Browse files
authored
fix conversion bug
1 parent fd42256 commit 21817d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sparse/compressed/convert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def transform_shape(shape):
4040
"""
4141
shape_bins = np.empty(len(shape),dtype=np.intp)
4242
shape_bins[-1] = 1
43-
for i in range(len(shape)-1):
44-
shape_bins[i] = np.prod(shape[i:-1])
43+
for i in range(len(shape)-2,-1,-1):
44+
shape_bins[i] = np.prod(shape[i+1:])
4545
return shape_bins
4646

4747
@numba.jit(nopython=True, nogil=True)

0 commit comments

Comments
 (0)