[Feature] TensorShape string layout descriptors#66
Merged
zacharyvincze merged 4 commits intoROCm:developfrom Sep 12, 2025
Merged
[Feature] TensorShape string layout descriptors#66zacharyvincze merged 4 commits intoROCm:developfrom
zacharyvincze merged 4 commits intoROCm:developfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds new string-based constructor overloads to the TensorShape class, allowing developers to specify tensor layouts using string descriptors (e.g., "NHWC", "HWC") instead of enum values. This provides a more convenient and readable way to create tensor shapes.
Key changes:
- Added string-to-enum mapping functionality for tensor layout descriptors
- Added two new TensorShape constructors that accept string layout descriptors
- Updated test cases to use the new string-based constructors
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| include/core/tensor_shape.hpp | Added new constructor declarations with string layout descriptors and updated documentation |
| src/core/tensor_shape.cpp | Implemented string-to-enum mapping function and new string-based constructors |
| tests/roccv/cpp/test_tensor.cpp | Updated all test cases to use new string-based TensorShape constructor syntax |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
jeffqjiangNew
approved these changes
Sep 11, 2025
paveltc
approved these changes
Sep 12, 2025
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.
Motivation
Adds additional constructors to TensorShape to define tensor layouts through string descriptors rather than enums.
Test Plan
test_tensor.cppto ensure it still compiles/passes tests.Test Result
Submission Checklist