Skip to content

Commit

Permalink
use tol=-1e16 to represent -inf for grad
Browse files Browse the repository at this point in the history
  • Loading branch information
chaozg committed Sep 13, 2024
1 parent 738f79b commit 8cc4300
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cuqi/distribution/_uniform.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def gradient(self, x):
Computes the gradient of logpdf at the given values of x.
"""
# x accepts scalar, list, tuple, or ndarray
return np.zeros_like(x)
tol = -1e16
return tol*np.ones_like(x)

def _sample(self,N=1, rng=None):

Expand Down

0 comments on commit 8cc4300

Please sign in to comment.