Could you provide a simple example of how to use @grad? I was trying to do this, but it is not working.
using ReverseDiff: gradient, @grad
minus(a,b) = a - b
@grad function minus(a, b)
return minus(data(a), data(b)), Δ -> (Δ, -Δ)
end
@show gradient(minus, 1,1)