[Python API] Added implicit input reshaping API and extended reshape() Unit Tests.
#32648
+431
−1
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.
Changes
New Overload: Adds a new overload to [Model.reshape] that accepts a list of shapes (e.g., [model.reshape([[2,2], [1,3,224,244], [10]]). Each shape in the list is assigned to the corresponding input in order.
Simplified API: This enables a more concise and intuitive way to reshape all model inputs, improving usability for common scenarios.
Tests: Adds unit tests to ensure the new API works as expected, including error handling for mismatched input counts.
Description
This PR also expands the Python API unit test suite for
Model.reshape()to cover additional usage patterns, edge cases, and validation scenarios. It builds on the existing reshape tests by:PartialShapewith tensor name coverage.All new tests follow the same upstream style:
Testing
All new tests pass locally against the latest OpenVINO build.
A clean version of: #31871
Closes: #18347