diff options
author | LU <32014765+LuYunChi@users.noreply.github.com> | 2022-12-07 09:29:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-07 15:29:31 +0100 |
commit | 2aad439eec34a80aaac0fd61a9b8de809710efa5 (patch) | |
tree | 09a4c02c31f92e41625c991243aa8e1263ec6f3d /numpy/array_api/_creation_functions.py | |
parent | 291b301f109f82564083dccda4b11f3949759778 (diff) | |
download | numpy-2aad439eec34a80aaac0fd61a9b8de809710efa5.tar.gz |
BUG: fix unexpected return of np.pad with mode=wrap (#22575)
np.pad with mode="wrap" returns unexpected result that original data is not strictly looped in padding. This may happen in some occassions when padding widths in the same dimension are unbalanced (see added testcase in test_arraypad.py and the related issue). The reason is the function pad makes iterative calls of _set_wrap_both() in the above situation, yet period for padding is not correctly computed in each iteration.
The bug is fixed by guaranteeing that period is always a multiple of original data size, and also be the possible maximum for computation efficiency.
Closes #22464
Co-authored-by: Lars GrĂ¼ter <lagru+github@mailbox.org>
Diffstat (limited to 'numpy/array_api/_creation_functions.py')
0 files changed, 0 insertions, 0 deletions