Skip to content

Commit 9f9df0e

Browse files
committed
- Replace tt.max and tt.min with tt.switch
1 parent 64009ec commit 9f9df0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: pymc3/distributions/discrete.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,9 @@ def logp(self, value):
930930
- betaln(n - value + 1, bad - n + value + 1)
931931
- betaln(tot + 1, 1)
932932
)
933-
lower = tt.max([0, n - N + k])
934-
upper = tt.min([k, n])
933+
# value in [max(0, n - N + k), min(k, n)]
934+
lower = tt.switch(tt.gt(n - N + k, 0), n - N + k, 0)
935+
upper = tt.switch(tt.lt(k, n), k, n)
935936
return bound(result, lower <= value, value <= upper)
936937

937938

0 commit comments

Comments
 (0)