Skip to content

Commit 0105f6c

Browse files
Rearrange conditional expression
1 parent 789a026 commit 0105f6c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tensorflow_probability/python/math/special.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,9 @@ def _betainc_partials(a, b, x):
434434

435435
# The partial derivatives of betainc with respect to a and b are computed
436436
# by using forward mode.
437-
use_power_series = ((x < a / (a + b)) & (b * x <= 1.) & (x <= 0.95) |
438-
((x >= a / (a + b)) & (a * (1. - x) <= 1.) & (x >= 0.05)))
437+
use_power_series = (
438+
((x < a / (a + b)) & (b * x <= one) & (x <= 0.95)) | (
439+
(x >= a / (a + b)) & (a * (one - x) <= one) & (x >= 0.05)))
439440
ps_grad_a, ps_grad_b = _betainc_der_power_series(
440441
a, b, x, dtype, use_power_series)
441442
cf_grad_a, cf_grad_b = _betainc_der_continued_fraction(

0 commit comments

Comments
 (0)