Skip to content

Commit 4929b64

Browse files
committed
Use tt.switch in DiscreteUniform for hard boundary (addresses previously failing test in 32bit OS)
1 parent 8c51062 commit 4929b64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pymc3/distributions/discrete.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,11 @@ def logcdf(self, value):
12921292
lower = self.lower
12931293

12941294
return bound(
1295-
tt.log(tt.minimum(tt.floor(value), upper) - lower + 1) - tt.log(upper - lower + 1),
1295+
tt.switch(
1296+
tt.lt(value, upper),
1297+
tt.log(tt.minimum(tt.floor(value), upper) - lower + 1) - tt.log(upper - lower + 1),
1298+
0,
1299+
),
12961300
lower <= value,
12971301
lower <= upper,
12981302
)

0 commit comments

Comments
 (0)