From 988f432b287421f7075e24258bb33472aabc807b Mon Sep 17 00:00:00 2001 From: Miguel Lloreda Date: Mon, 22 Oct 2018 09:13:58 -0500 Subject: [PATCH] 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. --- arrayfire/sparse.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arrayfire/sparse.py b/arrayfire/sparse.py index b261bdbd8..91b8f7a23 100644 --- a/arrayfire/sparse.py +++ b/arrayfire/sparse.py @@ -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): """