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

[TensorV2] Add Transpose Support for Tensor #2475

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

djeong20
Copy link
Contributor

This pull request adds the ability to transpose tensors, which allows users to flip or rotate their data along its axes.

Changes proposed in this PR:

  • Added a new method called transpose() to the TensorV2 class, which takes direction argument: the axes to be swapped.

Self-evaluation:

  1. Build test: [X]Passed [ ]Failed [ ]Skipped
  2. Run test: [X]Passed [ ]Failed [ ]Skipped

@taos-ci
Copy link
Collaborator

taos-ci commented Feb 19, 2024

📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2475. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/.

Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djeong20, 💯 All CI checkers are successfully verified. Thanks.


switch (from.getDataType()) {
case ml::train::TensorDim::DataType::FP32:
scopy(size(), from.getData<float>(), 1, (_FP16 *)getData(), 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using swich-case instead of previous if-else seems much better!

Copy link
Member

@DonghakPark DonghakPark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@jihochu jihochu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -21,6 +21,34 @@
#include <tensor_dim.h>
#include <util_func.h>

#define transposeloop(cl, ci, cj, ck, sl, si, sj, sk) \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it is working with omp directives in define. If it can, then we could try to apply it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. I think we should test it after when openMP is enabled. I'll keep it in mind and come back to this later.

Copy link
Collaborator

@jijoongmoon jijoongmoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except minor comment.

This pull request adds the ability to transpose tensors, which allows users to flip or rotate their data along its axes.

**Changes proposed in this PR:**
- Added a new method called transpose() to the TensorV2 class, which takes direction argument: the axes to be swapped.

**Self-evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test:   [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Donghyeon Jeong <[email protected]>
Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djeong20, 💯 All CI checkers are successfully verified. Thanks.

@djeong20 djeong20 added PR/OK2GO CI failed but okay to merge/review and removed rebase required PR/READY2MERGE labels Feb 23, 2024
@djeong20
Copy link
Contributor Author

Currently, the TAOS/CI clang-format version differs from Git action static checks. there's a mismatch that causes clang-format style error (the behavior of the clang-format varies for different versions). It is ok to merge.

@jijoongmoon jijoongmoon merged commit ca05ca5 into nnstreamer:main Feb 23, 2024
29 of 30 checks passed
@djeong20 djeong20 deleted the feat/tensor_v2/transpose branch February 26, 2024 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR/OK2GO CI failed but okay to merge/review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants