You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diffAt(::Val{order}, x) where {order} =productArray(Ref(x), _diffAt(Base.IteratorSize(x), Val(order), x))
68
+
_diffAt(::Base.HasLength, ::Val{order}, x) where {order} =fullderivative(Val(order), Base.OneTo(length(x)))
69
+
_diffAt(::Base.HasShape{1}, ::Val{order}, x) where {order} =fullderivative(Val(order), Base.OneTo(length(x)))
70
+
_diffAt(::Base.HasShape, ::Val{order}, x) where {order} =fullderivative(Val(order), CartesianIndices(axes(x)))
71
+
72
+
gradAt(x) =diffAt(Val(1), x)
73
+
grad(f) = x ->f.(gradAt(x)) # for f = rand(::GP), grad(f)(x) should work.
74
+
75
+
68
76
# idea: lazy mappings can be undone (extract original range -> towards a specialization speedup of broadcasting over multiple derivatives using backwardsdiff)
0 commit comments