@@ -80,24 +80,34 @@ export with_logabsdet_jacobian
80
80
struct NoLogAbsDetJacobian{F,T}
81
81
82
82
An instance `NoLogAbsDetJacobian{F,T}()` signifies that `with_logabsdet_jacobian(::F, ::T)` is not defined.
83
+
84
+ Constructors:
85
+ ```julia
86
+ NoLogAbsDetJacobian(f, x)
87
+ NoLogAbsDetJacobian{F,T}()
88
+ ```
83
89
"""
84
90
struct NoLogAbsDetJacobian{F,T} end
85
91
export NoLogAbsDetJacobian
86
92
87
- with_logabsdet_jacobian (:: F , :: T ) where {F,T} = NoLogAbsDetJacobian {F,T} ()
93
+ @inline NoLogAbsDetJacobian (:: F , :: T ) where {F,T} = NoLogAbsDetJacobian {F,T} ()
94
+ @inline NoLogAbsDetJacobian (:: Type{F} , :: T ) where {F,T} = NoLogAbsDetJacobian {Type{F},T} ()
95
+ @inline NoLogAbsDetJacobian (:: F , :: Type{T} ) where {F,T} = NoLogAbsDetJacobian {F,Type{T}} ()
96
+ @inline NoLogAbsDetJacobian (:: Type{F} , :: Type{T} ) where {F,T} = NoLogAbsDetJacobian {Type{F},Type{T}} ()
88
97
98
+ with_logabsdet_jacobian (f, x) = NoLogAbsDetJacobian (f, x)
89
99
90
100
91
101
@static if VERSION >= v " 1.6"
92
102
function with_logabsdet_jacobian (f:: Base.ComposedFunction , x)
93
103
y_ladj_inner = with_logabsdet_jacobian (f. inner, x)
94
104
if y_ladj_inner isa NoLogAbsDetJacobian
95
- NoLogAbsDetJacobian {typeof(f),typeof(x)} ( )
105
+ NoLogAbsDetJacobian (f, x )
96
106
else
97
107
y_inner, ladj_inner = y_ladj_inner
98
108
y_ladj_outer = with_logabsdet_jacobian (f. outer, y_inner)
99
109
if y_ladj_outer isa NoLogAbsDetJacobian
100
- NoLogAbsDetJacobian {typeof(f),typeof(x)} ( )
110
+ NoLogAbsDetJacobian (f, x )
101
111
else
102
112
y, ladj_outer = y_ladj_outer
103
113
(y, ladj_inner + ladj_outer)
0 commit comments