Skip to content

Conversation

@Sebastian-Larsson
Copy link
Collaborator

@Sebastian-Larsson Sebastian-Larsson commented Apr 30, 2025

Update op_upsample_bilinear2d.py and op_upsample_nearest2d.py
classes to replace assert checks with ValueError exceptions for
improved error handling and code robustness.

  • Change static shape checks from assertions to conditional raises of
    ValueError for clear runtime error communication.
  • Replaced assert checks for int16 range validation of scale_n_yx,
    scale_d_yx, and border_yx with explicit value range checks that
    raise ValueError when bounds are breached.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

Sebastian-Larsson and others added 2 commits April 28, 2025 09:32
Update `op_upsample_bilinear2d.py` and `op_upsample_nearest2d.py`
classes to replace `assert` checks with `ValueError` exceptions for
improved error handling and code robustness.

- Change static shape checks from assertions to conditional raises of
  `ValueError` for clear runtime error communication.
- Replaced `assert` checks for int16 range validation of `scale_n_yx`,
  `scale_d_yx`, and `border_yx` with explicit value range checks that
  raise `ValueError` when bounds are breached.

Signed-off-by: Sebastian Larsson <[email protected]>
Change-Id: I0f94182de97ab97abf752f4c618f2d435687ed3a
@Sebastian-Larsson Sebastian-Larsson added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk topic: not user facing labels Apr 30, 2025
@pytorch-bot
Copy link

pytorch-bot bot commented Apr 30, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10577

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit e53124b with merge base 12ed924 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 30, 2025
@zingo zingo merged commit c02dfd6 into pytorch:main Apr 30, 2025
174 of 175 checks passed
@Sebastian-Larsson Sebastian-Larsson deleted the assert_upsample branch May 15, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm topic: not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants