# using ReverseDiff function f(x, a) return sum(x .* a) end x0 = rand(5) a0 = rand(5) ReverseDiff.gradient(z->f(z, a0), x0)