It seems that Enzyme.jl currently does not (in default) support computing the derivatives of vector functions that take arguments of AbstractArray{<:AbstractArray{T}} as inputs.
julia> using Random
julia> Random.seed!(1234)
TaskLocalRNG()
julia> arg = [rand(2,3), rand(3,2), rand(2,2)];
julia> foo(x) = x[1] * x[2] + exp.(x[3])
foo (generic function with 1 method)
julia> foo(arg)
2×2 Matrix{Float64}:
1.66659 2.17893
2.65023 3.19387
julia> using Enzyme
julia> Enzyme.jacobian(Reverse, foo, arg, Val(4))
ERROR: MethodError: no method matching zero(::Type{Matrix{Float64}})
It seems that Enzyme.jl currently does not (in default) support computing the derivatives of vector functions that take arguments of
AbstractArray{<:AbstractArray{T}}
as inputs.