# Flux mutating updates?

**URL:** <https://discourse.julialang.org/t/flux-mutating-updates/46474>\
**Category:** New to Julia\
**Tags:** flux, zygote\
**Created:** [September 11, 2020, 7:25pm UTC](https://discourse.julialang.org/t/flux-mutating-updates/46474 "2020-09-11T19:25:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kc104](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@kc104](https://discourse.julialang.org/u/kc104)\
**Post date:** [September 11, 2020, 7:25pm UTC](https://discourse.julialang.org/t/flux-mutating-updates/46474/1 "2020-09-11T19:25:23Z")

</div>

I am trying to transfer a model from Python into Julia.

Each time I compute my loss function I sample the parameters in my model and store them in a struct. Trying to compute gradients of my loss using Flux gives an error that “Mutating arrays is not supported”.

Within the Flux source I see that it updates parameters using a [mutating operator](https://github.com/FluxML/Flux.jl/blob/master/src/optimise/train.jl). How is Flux able to use mutating operators in the !update function without throwing an error?
