File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11name = " LogExpFunctions"
22uuid = " 2ab3a3ac-af41-5b50-aa03-7779005ae688"
33authors = [
" StatsFun.jl contributors, Tamas K. Papp <[email protected] >" ]
4- version = " 0.3.24 "
4+ version = " 0.3.25 "
55
66[deps ]
77ChainRulesCore = " d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Original file line number Diff line number Diff line change @@ -231,7 +231,15 @@ See:
231231
232232Note: different than Maechler (2012), no negation inside parentheses
233233"""
234- log1mexp (x:: Real ) = x < IrrationalConstants. loghalf ? log1p (- exp (x)) : log (- expm1 (x))
234+ function log1mexp (x:: Real )
235+ # Use explicit `oftype(..)` instead of just `loghalf` to avoid CUDA issues:
236+ # https://github.com/JuliaStats/LogExpFunctions.jl/issues/73
237+ if x < oftype (float (x), IrrationalConstants. loghalf)
238+ return log1p (- exp (x))
239+ else
240+ return log (- expm1 (x))
241+ end
242+ end
235243
236244"""
237245$(SIGNATURES)
You can’t perform that action at this time.
0 commit comments