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
prepare_gradient doesn't work when the first argument of f is either Constant or Cache.
functionmy_f(a, x)
return a *sum(abs2, x)
endfunctionmy_f2(x, a)
return a *sum(abs2, x)
end
a =0.1
x =rand(100)
backend =AutoMooncake(; config=nothing)
prep =prepare_gradient(my_f, backend, Constant(a), x) # doesn't work
prep2 =prepare_gradient(my_f2, backend, x, Constant(a)) # works
prepare_gradientdoesn't work when the first argument offis eitherConstantorCache.