Change backend from sparse to np.array.
(self)
| 993 | return self._new(data=data) |
| 994 | |
| 995 | def _to_dense(self) -> NamedArray[Any, _DType_co]: |
| 996 | """ |
| 997 | Change backend from sparse to np.array. |
| 998 | """ |
| 999 | if isinstance(self._data, _sparsearrayfunction_or_api): |
| 1000 | data_dense: np.ndarray[Any, _DType_co] = self._data.todense() |
| 1001 | return self._new(data=data_dense) |
| 1002 | else: |
| 1003 | raise TypeError("self.data is not a sparse array") |
| 1004 | |
| 1005 | def permute_dims( |
| 1006 | self, |