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

Refactoring the tensor operation codebase: improving navigation and testing #1610

Open
antimora opened this issue Apr 12, 2024 · 0 comments
Open
Assignees
Labels
enhancement Enhance existing features

Comments

@antimora
Copy link
Collaborator

antimora commented Apr 12, 2024

I have added close to ten tensor operations by now, and I have two major pain points that I want to fix:

I had to jump between different files to add a new operation. The files have become even bigger, so it's more difficult to navigate.
Tensor tests are wrapped with a macro, and editing code feels like I am editing plain text. Favorite IDE features, such as auto-completion or correct method lookup, do not work.
Here is my proposal:

For pain point 1:

Organize the code around tensor operations. This means one file per operation. All implementations for Numeric, Float, Int, and Boolean traits will be in the same file. Also, exportable tests will be in the same file.

For pain point 2:

Instead of relying on macros to export, we should use the rstest/rstest_reuse crate to make unit tests exportable, so that these tests can be imported into other backends. This way, we can ensure that the code is compilable and auto-completion is used.

@antimora antimora self-assigned this Apr 12, 2024
@antimora antimora added the enhancement Enhance existing features label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance existing features
Projects
None yet
Development

No branches or pull requests

1 participant