Skip to content

Commit

Permalink
Fixed issue with create_sparse_from_host - (issue #189).
Browse files Browse the repository at this point in the history
Casted row and column index arrays to be of s32 type prior to passing in to
lib call. Previously failing due to failing assertions.
  • Loading branch information
mlloreda authored and pavanky committed Oct 23, 2018
1 parent c9cac8c commit 988f432
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arrayfire/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ def create_sparse_from_host(values, row_idx, col_idx, nrows, ncols, storage = ST
A sparse matrix.
"""
return create_sparse(to_array(values), to_array(row_idx), to_array(col_idx), nrows, ncols, storage)
return create_sparse(to_array(values),
to_array(row_idx).as_type(Dtype.s32),
to_array(col_idx).as_type(Dtype.s32),
nrows, ncols, storage)

def create_sparse_from_dense(dense, storage = STORAGE.CSR):
"""
Expand Down

0 comments on commit 988f432

Please sign in to comment.