Commit ffb7a08
Fix torch.histc not checking min > max on cuda for int8 tensors (pytorch#139372)
Fixes pytorch#139360
https://github.com/pytorch/pytorch/blob/86e6513c86c49f219cfc8c539de2ccf9de97ccf0/aten/src/ATen/native/cuda/SummaryOps.cu#L323-L324
Assign `min` and `max` to with low-precision input_t variable `minvalue` and `maxvalue` cause wrong comparing result in following check in here:
https://github.com/pytorch/pytorch/blob/86e6513c86c49f219cfc8c539de2ccf9de97ccf0/aten/src/ATen/native/cuda/SummaryOps.cu#L353

Change type of `minvalue` and `maxvalue` to fix it, similar like in line:
https://github.com/pytorch/pytorch/blob/86e6513c86c49f219cfc8c539de2ccf9de97ccf0/aten/src/ATen/native/cuda/SummaryOps.cu#L280-L282
**Test Result**
```bash
$ pytest test/test_reductions.py -vv
```

```bash
$ lintrunner
```

Pull Request resolved: pytorch#139372
Approved by: https://github.com/eqy1 parent 356fc41 commit ffb7a08
File tree
3 files changed
+29
-3
lines changed- aten/src/ATen/native/cuda
- test
- torch/testing/_internal
3 files changed
+29
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
325 | 327 | | |
326 | 328 | | |
327 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3116 | 3116 | | |
3117 | 3117 | | |
3118 | 3118 | | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
3119 | 3143 | | |
3120 | 3144 | | |
3121 | 3145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19375 | 19375 | | |
19376 | 19376 | | |
19377 | 19377 | | |
19378 | | - | |
| 19378 | + | |
19379 | 19379 | | |
19380 | 19380 | | |
19381 | 19381 | | |
| |||
0 commit comments