fix: Fixed numpy 1.12 indexing and shape preservation

This commit is contained in:
mzwiessele 2017-02-23 14:45:18 +00:00
parent afe37dbfd8
commit 6cd13ac2b3
9 changed files with 26 additions and 25 deletions

View file

@ -68,12 +68,12 @@ class GpGrid(GP):
for b in (B.T):
x = b
N = 1
G = np.zeros(D)
G = np.zeros(D, dtype=np.int_)
for d in range(D):
G[d] = len(A[d])
N = np.prod(G)
for d in range(D-1, -1, -1):
X = np.reshape(x, (G[d], np.round(N/G[d])), order='F')
X = np.reshape(x, (G[d], int(np.round(N/G[d]))), order='F')
Z = np.dot(A[d], X)
Z = Z.T
x = np.reshape(Z, (-1, 1), order='F')