# Flux Zygote Gradient: Understanding Mutating arrays is not supported

**URL:** <https://discourse.julialang.org/t/flux-zygote-gradient-understanding-mutating-arrays-is-not-supported/46324>\
**Category:** Machine Learning\
**Created:** [September 9, 2020, 11:36am UTC](https://discourse.julialang.org/t/flux-zygote-gradient-understanding-mutating-arrays-is-not-supported/46324 "2020-09-09T11:36:41Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [November 27, 2020, 9:33am UTC](https://discourse.julialang.org/t/flux-zygote-gradient-understanding-mutating-arrays-is-not-supported/46324/21 "2020-11-27T09:33:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rakeshvar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rakeshvar/32/3613_2.png) [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Post date:** [December 3, 2020, 5:21am UTC](https://discourse.julialang.org/t/flux-zygote-gradient-understanding-mutating-arrays-is-not-supported/46324/22 "2020-12-03T05:21:49Z")

</div>

Please see this example.

[https://github.com/rakeshvar/Zygote-Mutating-Arrays-WorkAround.jl](https://github.com/rakeshvar/Zygote-Mutating-Arrays-WorkAround.jl)

[Previous page](https://discourse.julialang.org/t/flux-zygote-gradient-understanding-mutating-arrays-is-not-supported/46324.md?page=1)
