Removed todense on sparse arrays