I am trying to define custom Enzyme rules for my package ImplicitDifferentiation.jl, but I’m held back by type inference failures inside my rules. The typical error message looks like
Enzyme execution failed.
Enzyme: incorrect return type of shadow-only forward custom rule -
BatchDuplicatedNoNeed{Vector{Float32}, 2} Type[Const{ImplicitFunction{var"#forward#44", var"#conditions#45", typeof(\), Nothing, Nothing}}, BatchDuplicated{Vector{Float32}, 2}]
want just shadow type Tuple{Vector{Float32}, Vector{Float32}}
found Tuple{Any, Any}
Is there no way to define a custom rule if it is not fully inferrable?