mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
fix numpy compatibility for 2d small list indices (#154806)
Will fix #119548 and linked issues once we switch from warning to the new behavior, but for now, given how much this syntax was used in our test suite, we suspect a silent change will be disruptive. We will change the behavior after 2.8 branch is cut. Numpy behavior was changed at least in numpy 1.24 (more than 2 years ago) Pull Request resolved: https://github.com/pytorch/pytorch/pull/154806 Approved by: https://github.com/cyyever, https://github.com/Skylion007, https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
e2760544fa
commit
34e3930401
@ -124,7 +124,7 @@ def multidim_slicer(dims, slices, *tensors):
|
||||
for d, d_slice in zip(dims, slices):
|
||||
if d is not None:
|
||||
s[d] = d_slice
|
||||
yield t[s]
|
||||
yield t[tuple(s)]
|
||||
|
||||
|
||||
def ptr_stride_extractor(*tensors):
|
||||
|
Reference in New Issue
Block a user