Refactor project to modularize Tensor code into separate files#16
Merged
PaytonWebber merged 7 commits intomainfrom Jan 29, 2025
Merged
Refactor project to modularize Tensor code into separate files#16PaytonWebber merged 7 commits intomainfrom
PaytonWebber merged 7 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request reorganizes the existing Tensor library into multiple modules and files, making the codebase more maintainable and easier to navigate. Previously, most of the functionality was in one large file. Now, the project is broken out into logically separated modules under
src/core/. The following modules were created:ops/,errors.rs,traits.rs, andutils.rs. This restructuring follows common Rust patterns and should make it simpler to develop, test, and maintain features going forward.Changes
corefolder undersrc/, containing:mod.rsas the main entry point for the tensor module.errors.rs,traits.rs, andutils.rsfor their respective uses that their name implies.opssubfolder that holds separate files for binary, unary, movement, and reduction operations (binary.rs,unary.rs,movement.rs,reduce.rs). Thebroadcast.rsfile is also held in theopsdirectory, and is only used inbinary.rs. Learn more about broadcasting here.is_broadcastable,compute_broadcast_shape_and_strides, etc.) intobroadcast.rs.errors.rsfile.traits.rs.unravel_index) intoutils.rs.opsfolder.Benefits
Testing & Verification