A reduction to count the number of elements in a sparse array, excluding nans. This will in general result in a dense matrix with an unpredictable fill value. So make it official and convert it to dense. https://github.com/dask/dask/issues/7169
(x, **kwargs)
| 323 | |
| 324 | |
| 325 | def _nannumel_sparse(x, **kwargs): |
| 326 | """ |
| 327 | A reduction to count the number of elements in a sparse array, excluding nans. |
| 328 | This will in general result in a dense matrix with an unpredictable fill value. |
| 329 | So make it official and convert it to dense. |
| 330 | |
| 331 | https://github.com/dask/dask/issues/7169 |
| 332 | """ |
| 333 | n = _nannumel(x, **kwargs) |
| 334 | # If all dimensions are contracted, this will just be a number, otherwise we |
| 335 | # want to densify it. |
| 336 | return n.todense() if hasattr(n, "todense") else n |
| 337 | |
| 338 | |
| 339 | class ArrayBackendEntrypoint(DaskBackendEntrypoint): |
nothing calls this directly
no test coverage detected