Skip to content

[Feature] TensorShape string layout descriptors#66

Merged
zacharyvincze merged 4 commits intoROCm:developfrom
zacharyvincze:zv/feature/string-tensor-layout
Sep 12, 2025
Merged

[Feature] TensorShape string layout descriptors#66
zacharyvincze merged 4 commits intoROCm:developfrom
zacharyvincze:zv/feature/string-tensor-layout

Conversation

@zacharyvincze
Copy link
Copy Markdown
Contributor

Motivation

Adds additional constructors to TensorShape to define tensor layouts through string descriptors rather than enums.

Test Plan

  • Changes the TensorShape construction method in test_tensor.cpp to ensure it still compiles/passes tests.

Test Result

  • C++ tests passing as expected.

Submission Checklist

@zacharyvincze zacharyvincze added documentation Improvements or additions to documentation enhancement New feature or request ci:precheckin labels Sep 11, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@zacharyvincze zacharyvincze merged commit 11f2567 into ROCm:develop Sep 12, 2025
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:precheckin documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants