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

fix/ndarray: remove reversed axes check #1058

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

AuruTus
Copy link
Contributor

@AuruTus AuruTus commented Dec 11, 2023

Pull Request Template

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

fix #1053

Changes

Remove reversed axes layout check to allow column major tensor to be reshaped into row major.

Testing

Ran cargo test under burn-ndarray and run-checks all

NOTE: Although the shape() bug can be fixed by this, there is still some weird logic in ndarry::concatenate(...) function to compute new strides for empty tensors where they prefer to producing column major layout. Maybe we should call reshape(...) in NdArrayOps::cat(...) too and add some tests against the cat result.

@AuruTus AuruTus marked this pull request as draft December 11, 2023 11:10
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3066196) 85.57% compared to head (ce6805d) 85.52%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1058      +/-   ##
==========================================
- Coverage   85.57%   85.52%   -0.05%     
==========================================
  Files         508      508              
  Lines       53912    54068     +156     
==========================================
+ Hits        46133    46241     +108     
- Misses       7779     7827      +48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AuruTus AuruTus changed the title WIP: fix/ndarray: remove reversed axes check fix/ndarray: remove reversed axes check Dec 12, 2023
@AuruTus AuruTus marked this pull request as ready for review December 12, 2023 15:01
@nathanielsimard
Copy link
Member

@AuruTus I think it would be valuable to add the code snippet from this issue #1053 as a test before merging. The test should be generic over the backend in burn-tensor/src/tests

@AuruTus
Copy link
Contributor Author

AuruTus commented Dec 13, 2023

@AuruTus I think it would be valuable to add the code snippet from this issue #1053 as a test before merging. The test should be generic over the backend in burn-tensor/src/tests

Sure, I add it under stack 's unit tests. That reshaping after stacking test can cover all backends now.

@nathanielsimard nathanielsimard merged commit fc97a28 into tracel-ai:main Dec 14, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong result when call reshape() after Tensor::stack
2 participants