-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
Description
Using += with a view of the same array sometimes is broken. To reproduce run
for n in range(80, 100):
h = np.random.randn(n, n)
h += h.T
print(n, np.linalg.norm(h - h.T))This produces a bunch of zeros (correct result), followed by a bunch of finite numbers of order 1 (wrong). For me the result is wrong for n > 90.
Replacing h += h.T with h = h + h.T or anything equivalent fixes the issue.
I have verified that the issue appears in linux pip installation of numpy v1.9.2 in python 2, as well as python 3. In particular, it is reproducible on http://try.jupyter.org.