julia> using ChainRulesCore
julia> function get_error(G, E, x)
n, m = size(G)
Ê = @ignore_derivatives repeat(E, inner=(1, m))
Ĝ = repeat(G, inner=(1, m))
return Ĝ * prod(x.^Ê, dims=1)'
end
get_error (generic function with 1 method)
julia> gs = jacobian((G,x) -> get_error(G,E,x), G, x)
([3.0 0.0 … 3.0 0.0; 0.0 3.0 … 0.0 3.0], [3.0 4.5; 4.5 3.0])