@@ -6,6 +6,15 @@ using MeasureBase
66using ChainRulesCore: NoTangent, ZeroTangent
77import ChainRulesCore
88
9+ # = utils ====================================================================
10+
11+ using MeasureBase: isneginf, isposinf
12+
13+ _isneginf_pullback (:: Any ) = (NoTangent (), ZeroTangent ())
14+ ChainRulesCore. rrule (:: typeof (isneginf), x) = isneginf (x), _logdensityof_rt_pullback
15+
16+ _isposinf_pullback (:: Any ) = (NoTangent (), ZeroTangent ())
17+ ChainRulesCore. rrule (:: typeof (isposinf), x) = isposinf (x), _isposinf_pullback
918
1019# = insupport & friends ======================================================
1120
@@ -36,4 +45,13 @@ ChainRulesCore.rrule(::typeof(checked_arg), ν, x) = checked_arg(ν, x), _checke
3645_check_dof_pullback (ΔΩ) = NoTangent (), NoTangent (), NoTangent ()
3746ChainRulesCore. rrule (:: typeof (check_dof), ν, μ) = check_dof (ν, μ), _check_dof_pullback
3847
48+ # = return type inference ====================================================
49+
50+ using MeasureBase: logdensityof_rt
51+
52+ _logdensityof_rt_pullback (:: Any ) = (NoTangent (), NoTangent (), ZeroTangent ())
53+ function ChainRulesCore. rrule (:: typeof (logdensityof_rt), target, v)
54+ logdensityof_rt (target, v), _logdensityof_rt_pullback
55+ end
56+
3957end # module MeasureBaseChainRulesCoreExt
0 commit comments