Skip to content

Commit 988f432

Browse files
mlloredapavanky
authored andcommitted
Fixed issue with create_sparse_from_host - (issue #189).
Casted row and column index arrays to be of s32 type prior to passing in to lib call. Previously failing due to failing assertions.
1 parent c9cac8c commit 988f432

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arrayfire/sparse.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def create_sparse_from_host(values, row_idx, col_idx, nrows, ncols, storage = ST
9090
9191
A sparse matrix.
9292
"""
93-
return create_sparse(to_array(values), to_array(row_idx), to_array(col_idx), nrows, ncols, storage)
93+
return create_sparse(to_array(values),
94+
to_array(row_idx).as_type(Dtype.s32),
95+
to_array(col_idx).as_type(Dtype.s32),
96+
nrows, ncols, storage)
9497

9598
def create_sparse_from_dense(dense, storage = STORAGE.CSR):
9699
"""

0 commit comments

Comments
 (0)