Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion filterpy/kalman/unscented_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def residual(a, b):
# this is the fast way to do this - see 'else' for the slow way
if residual_fn is np.subtract or residual_fn is None:
y = sigmas - x[np.newaxis, :]
P = np.dot(y.T, np.dot(np.diag(Wc), y))
#P = np.dot(y.T, np.dot(np.diag(Wc), y)) #Numpy 2.4.0 memory leak in np.diag https://github.com/numpy/numpy/issues/30862
P = y.T @ (y * Wc[:, None]) # Achieves the same using broadcasting, avoids memory leak bug, saves memory and is faster
else:
P = np.zeros((n, n))
for k in range(kmax):
Expand Down