In the end, you densify the output with `toarray()`. Thus I would remove this implementation trick.