Skip to content

COO.transpose() is not cheap #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
eric-wieser opened this issue Mar 3, 2020 · 3 comments
Open

COO.transpose() is not cheap #329

eric-wieser opened this issue Mar 3, 2020 · 3 comments
Labels
enhancement Indicates new feature requests

Comments

@eric-wieser
Copy link
Contributor

Transposing a COO array results in a reordering of all the data elements.

Would it be possible to avoid doing this?

@eric-wieser eric-wieser added the enhancement Indicates new feature requests label Mar 3, 2020
@hameerabbasi
Copy link
Collaborator

One way would be to make a small "library"/submodule that handled views of COO. But I cannot think of a clean way without breaking the current guarantee that COO will always have ordered elements.

We were evaluating using the TACO compiler, (#326) which would in theory make this O(1), but that's an even larger undertaking, and at least with my current knowledge, beyond my skills.

@eric-wieser
Copy link
Contributor Author

eric-wieser commented Mar 3, 2020

without breaking the current guarantee that COO will always have ordered elements

You could relax the guarantee to "Elements of self.transpose(self._axis_order)" are ordered, which would mean storing an extra property.

@perimosocordiae
Copy link

You could define a TransposedCOO wrapper class that re-writes axes before passing through to the underlying COO class. This is essentially the approach we use for CSR/CSC matrices in scipy.sparse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

3 participants