Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jax numpy deprecation #123

Closed
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
4 changes: 2 additions & 2 deletions jax_cosmo/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def _block_det(sparse, k, N, P):
v = sparse[k + 1 : N, k : k + 1, 0:P]
Sinv_v = sparse_dot_sparse(inv(S), v)
M = sparse[k, k] - sparse_dot_sparse(u, Sinv_v)
sign = np.product(np.sign(M))
sign = np.prod(np.sign(M))
logdet = np.sum(np.log(np.abs(M)))
return sign, logdet

Expand Down Expand Up @@ -354,7 +354,7 @@ def slogdet(sparse):
"""
sparse = check_sparse(sparse, square=True)
N, _, P = sparse.shape
sign = np.product(np.sign(sparse[-1, -1]))
sign = np.prod(np.sign(sparse[-1, -1]))
logdet = np.sum(np.log(np.abs(sparse[-1, -1])))
# The individual blocks can be calculated in any order so there
# should be a better way to express this using lax.map but I
Expand Down
Loading