You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe it is normal behavior but imho it shoud not be. zeros_like function return COO format even if DOK is asked.
Example
In[1]: import numpy as np
In[2]: import sparse as sp
In[3]: a = np.random.random((10,10,10))
In[4]: s = sp.zeros_like(a, format='dok')
In[5]: s
Out[5]: <COO: shape=(10, 10, 10), dtype=float64, nnz=0, fill_value=0.0>
Note that even starting from a COO and asking for a DOK doesn't work:
In[6]: d = sp.zeros_like(s, format='dok')
In[7]: d
Out[7]: <COO: shape=(10, 10, 10), dtype=float64, nnz=0, fill_value=0.0>
Expected behavior
zeros_like should return DOK format if DOK format is asked.
System
OS and version: Ubuntu 18.04.4 LTS (kernel 5.3.0-62-generic)
Python 3.8.3
sparse version: 0.10.0 (from conda-forge)
NumPy version: 1.18.5
Numba version: 0.50.1
Additional comment
I looked for a previous notice of this bug but found none. Sorry if it was already reported.
For the moment, I bypass this by using zeros (which works) instead.
The text was updated successfully, but these errors were encountered:
Bug description
Maybe it is normal behavior but imho it shoud not be.
zeros_like
function return COO format even if DOK is asked.Example
Note that even starting from a COO and asking for a DOK doesn't work:
Expected behavior
zeros_like
should return DOK format if DOK format is asked.System
sparse
version: 0.10.0 (from conda-forge)Additional comment
I looked for a previous notice of this bug but found none. Sorry if it was already reported.
For the moment, I bypass this by using
zeros
(which works) instead.The text was updated successfully, but these errors were encountered: