Repository navigation
Commit 99afd2c
Skip ATen-mode out-of-range integer clamp/hardtanh death tests (pytorch#21933)
pytorch/pytorch#193169 changes how ATen's scalar `clamp` handles an
out-of-range
integer bound. Instead of converting the bound straight to the input
dtype
(which raised for signed dtypes and silently wrapped for unsigned ones),
ATen
now reconciles the bound by direction: a `min` below the dtype's range
(or a
`max` above it) is a no-op and is dropped, while the opposite direction
is
rejected. `hardtanh` shares this behavior.
The portable kernels keep their own strict bounds check and are
unaffected, but
the ATen-mode death tests (built with -DUSE_ATEN_LIB) assume every
out-of-range
integer bound raises, which no longer holds. Skip those integer cases in
ATen
mode, matching the existing skips for negative uint8 and out-of-range
int32
bounds:
- op_clamp_test: ByteTensorTooLargeClampDies
- op_hardtanh_test: ByteTensorTooLargeScalarDies,
CharTensorTooSmallScalarDies,
ShortTensorTooLargeScalarDies (gated in the fixture helper, not the
shared
ScalarOverflowTestMacros.h, which eight suites depend on)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
### Summary
[PLEASE REMOVE] See [CONTRIBUTING.md's Pull
Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests)
for ExecuTorch PR guidelines.
[PLEASE REMOVE] If this PR closes an issue, please add a `Fixes
#<issue-id>` line.
[PLEASE REMOVE] If this PR introduces a fix or feature that should be
the upcoming release notes, please add a "Release notes: <area>" label.
For a list of available release notes labels, check out
[CONTRIBUTING.md's Pull
Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests).
### Test plan
[PLEASE REMOVE] How did you test this PR? Please write down any manual
commands you used and note down tests that you have written if
applicable.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 1c64a66 commit 99afd2c
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
371 | 375 | | |
372 | 376 | | |
373 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
| |||
0 commit comments