diff --git a/src/default.jl b/src/default.jl index c72b8f06..bac852be 100644 --- a/src/default.jl +++ b/src/default.jl @@ -1,8 +1,8 @@ # -__default_AD_backend = AutoForwardDiff() +const __default_AD_backend = Ref(AutoForwardDiff()) function set_AD_backend(AD) - global __default_AD_backend = AD + global __default_AD_backend[] = AD nothing end @@ -13,7 +13,7 @@ Used to set the default value of Automatic Differentiation backend. The default value is `AutoForwardDiff()`, that is the `ForwardDiff` package is used by default. """ -__get_AD_backend() = __default_AD_backend # default AD backend +__get_AD_backend() = __default_AD_backend[] # default AD backend """ $(TYPEDSIGNATURES)