Skip to content
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

Continue cleaning up the sparse/dense tensor types #886

Closed
brandonwillard opened this issue Apr 5, 2022 · 5 comments · Fixed by #1192
Closed

Continue cleaning up the sparse/dense tensor types #886

brandonwillard opened this issue Apr 5, 2022 · 5 comments · Fixed by #1192
Labels
important refactor This issue involves refactoring sparse tensors

Comments

@brandonwillard
Copy link
Member

Currently, TensorTypes aren't an abstract class, and direct instances of TensorTypes represent dense tensors, as do instances of the new DenseTensorType.

Instead, it would be better to have and use a single abstract tensor Type and distinct sparse and dense tensor Types. In this case, we could remove all the meta classes.

One of the issues I can see with this change: external libraries that use TensorType and/or TensorVariables directly will need to change these to DenseTensorType and DenseTensorVariable, unless we continue to keep these names reserved for dense tensors and use new AbstractTensor[Type|Variable] classes as the shared base.

Originally posted by @brandonwillard in #766 (review)

@ricardoV94
Copy link
Contributor

Sounds less painful to keep the current TensorType as is and add the new abstract class

@rlouf
Copy link
Member

rlouf commented Apr 6, 2022

Sounds less painful to keep the current TensorType as is and add the new abstract class

I agree, and although DenseTensorType is more explicit I think it would confuse most people. Everyone is used to "dense" being the default.

@brandonwillard
Copy link
Member Author

Yeah, we can make Tensor[Type|Variable] aliases for DenseTensor[Type|Variable] and remove all uses of Tensor[Type|Variable] from internal code. That should clear things up a lot.

@danhphan
Copy link
Contributor

Hi, I can work on this task. Thanks

@brandonwillard
Copy link
Member Author

Hi, I can work on this task. Thanks

That would be great!

@rlouf rlouf linked a pull request Sep 17, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
important refactor This issue involves refactoring sparse tensors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants