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 1
1
name = " LogExpFunctions"
2
2
uuid = " 2ab3a3ac-af41-5b50-aa03-7779005ae688"
3
3
authors = [
" StatsFun.jl contributors, Tamas K. Papp <[email protected] >" ]
4
- version = " 0.3.24 "
4
+ version = " 0.3.25 "
5
5
6
6
[deps ]
7
7
ChainRulesCore = " d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Original file line number Diff line number Diff line change @@ -231,7 +231,15 @@ See:
231
231
232
232
Note: different than Maechler (2012), no negation inside parentheses
233
233
"""
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
235
243
236
244
"""
237
245
$(SIGNATURES)
You can’t perform that action at this time.
0 commit comments