mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "[indexing] Prevent integer overflow from large step values in C++ (#161707)"
This reverts commit c140bf217f5ca5071ab9dbc1bcf9d4006242f44a. Reverted https://github.com/pytorch/pytorch/pull/161707 on behalf of https://github.com/huydhn due to Look like there is a land race as lots of jobs are failing after this lands ([comment](https://github.com/pytorch/pytorch/pull/161707#issuecomment-3283980465))
This commit is contained in:
@ -759,8 +759,7 @@ def slice_forward(
|
||||
|
||||
storage_offset = self.storage_offset() + start_val * strides[dim]
|
||||
len = end_val - start_val
|
||||
# safely round-up for corresponding c++ impl
|
||||
sizes[dim] = (len // step) + (1 if len % step != 0 else 0)
|
||||
sizes[dim] = (len + step - 1) // step
|
||||
strides[dim] *= step
|
||||
|
||||
if self.is_quantized:
|
||||
|
Reference in New Issue
Block a user