Skip to content

Accept a ShapeRange in NeuralNetworkImageSizeRange add_height_range and add_width_range - #2871

Open
kwy404 wants to merge 1 commit into
apple:mainfrom
kwy404:fix-image-size-range-shaperange
Open

kwy404 wants to merge 1 commit into
apple:mainfrom
kwy404:fix-image-size-range-shaperange

Conversation

@kwy404

@kwy404 kwy404 commented Sep 25, 2026

Copy link
Copy Markdown

NeuralNetworkImageSizeRange.add_width_range and add_height_range accept a ShapeRange or a tuple, but they always index the argument, so passing a ShapeRange raised TypeError: 'ShapeRange' object is not subscriptable. They now wrap only tuples and store a ShapeRange as given, matching the constructor, and the update_image_size_range docstring example now passes tuples instead of two positional arguments. Added a test that runs off macOS.

@TobyRoseman

Copy link
Copy Markdown
Collaborator

This change looks good.

CI: https://gitlab.com/coremltools1/coremltools/-/pipelines/2899199742

@kwy404

kwy404 commented Oct 2, 2026

Copy link
Copy Markdown
Author

Thanks for the review and for running CI, @TobyRoseman!

This branch has not been deployed

No deployments
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.

2 participants