Skip to content

Commit 48d1ffb

Browse files
committed
Changing sparse* functions to create_sparse*
1 parent 300c7d0 commit 48d1ffb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

arrayfire/sparse.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
STORAGE.COO]
2323

2424

25-
def sparse(values, row_idx, col_idx, nrows, ncols, storage = STORAGE.CSR):
25+
def create_sparse(values, row_idx, col_idx, nrows, ncols, storage = STORAGE.CSR):
2626
"""
2727
Create a sparse matrix from it's constituent parts.
2828
@@ -60,7 +60,7 @@ def sparse(values, row_idx, col_idx, nrows, ncols, storage = STORAGE.CSR):
6060
values.arr, row_idx.arr, col_idx.arr, storage.value))
6161
return out
6262

63-
def sparse_from_host(values, row_idx, col_idx, nrows, ncols, storage = STORAGE.CSR):
63+
def create_sparse_from_host(values, row_idx, col_idx, nrows, ncols, storage = STORAGE.CSR):
6464
"""
6565
Create a sparse matrix from it's constituent parts.
6666
@@ -90,9 +90,9 @@ def sparse_from_host(values, row_idx, col_idx, nrows, ncols, storage = STORAGE.C
9090
9191
A sparse matrix.
9292
"""
93-
return sparse(to_array(values), to_array(row_idx), to_array(col_idx), nrows, ncols, storage)
93+
return create_sparse(to_array(values), to_array(row_idx), to_array(col_idx), nrows, ncols, storage)
9494

95-
def sparse_from_dense(dense, storage = STORAGE.CSR):
95+
def create_sparse_from_dense(dense, storage = STORAGE.CSR):
9696
"""
9797
Create a sparse matrix from a dense matrix.
9898
@@ -115,7 +115,7 @@ def sparse_from_dense(dense, storage = STORAGE.CSR):
115115
safe_call(backend.get().af_create_sparse_array_from_dense(c_pointer(out.arr), dense.arr, storage.value))
116116
return out
117117

118-
def sparse_to_dense(sparse):
118+
def create_sparse_to_dense(sparse):
119119
"""
120120
Create a dense matrix from a sparse matrix.
121121

arrayfire/tests/simple/sparse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def simple_sparse(verbose=False):
1717

1818
dd = af.randu(5, 5)
1919
ds = dd * (dd > 0.5)
20-
sp = af.sparse_from_dense(ds)
20+
sp = af.create_sparse_from_dense(ds)
2121
display_func(af.sparse_get_info(sp))
2222
display_func(af.sparse_get_values(sp))
2323
display_func(af.sparse_get_row_idx(sp))

0 commit comments

Comments
 (0)