Combining Lux.jl with Optimization.jl

sorry, I somehow haven’t read correctly - writing it Ref triggered now :+1: . Sure, this restores state by making it implicit. Got it. Still no way to have explicit state, but really good to know. Do you know whether it is safe to use such implicit state within Optimization?

EDIT: Thank you very much Chris for all your immediate support, thank you for recommending this workaround.

Very impressive, so really ODEs are not compatible with custom updateable state. I’ve no clue what is going on behind the scene which breaks this. Is there an issue which describes the problem?