Hi R, Thanks for that. It may be @nograd that I needed, as @ignore did not work for what I needed. I needed to iteratively construct an array not containing any variables relevant to the gradients (i.e. which therefore should not matter to Zygote but did), and then use the finished product of this in one matrix (allowable) multiplication with variables. If I use the @ignore, then the array is not visible at all, but maybe with @nograd it will work.
BTW is there any chance you could share your example?
Please see this example.
https://github.com/rakeshvar/Zygote-Mutating-Arrays-WorkAround.jl
3 Likes