fix: Fixed numpy 1.12 indexing and shape preservation

This commit is contained in:
mzwiessele 2017-02-23 14:45:18 +00:00 committed by Akash Kumar Dhaka
parent a7a2e53f6d
commit 96cc0838eb
9 changed files with 26 additions and 25 deletions

View file

@ -36,12 +36,12 @@ class GaussianGridInference(LatentFunctionInference):
x = b
N = 1
D = len(A)
G = np.zeros((D,1))
G = np.zeros((D), dtype=np.int_)
for d in range(0, 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')