diff --git a/src/tracers.jl b/src/tracers.jl index 9d66f9a..74382e8 100644 --- a/src/tracers.jl +++ b/src/tracers.jl @@ -101,7 +101,11 @@ end primal(d::Dual) = d.primal tracer(d::Dual) = d.tracer -isemptytracer(d::Dual) = isemptytracer(tracer(d)) + +gradient(d::Dual{P,T}) where {P,T<:GradientTracer} = gradient(tracer(d)) +gradient(d::Dual{P,T}) where {P,T<:HessianTracer} = gradient(tracer(d)) +hessian(d::Dual{P,T}) where {P,T<:HessianTracer} = hessian(tracer(d)) +isemptytracer(d::Dual) = isemptytracer(tracer(d)) Dual{P,T}(d::Dual{P,T}) where {P<:Real,T<:AbstractTracer} = d Dual(primal::P, tracer::T) where {P,T} = Dual{P,T}(primal, tracer)