# Help with gradient

**URL:** <https://discourse.julialang.org/t/help-with-gradient/33943>\
**Category:** Machine Learning\
**Tags:** flux\
**Created:** [January 29, 2020, 6:42pm UTC](https://discourse.julialang.org/t/help-with-gradient/33943 "2020-01-29T18:42:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 30, 2020, 1:27pm UTC](https://discourse.julialang.org/t/help-with-gradient/33943/2 "2020-01-30T13:27:55Z")

</div>

Do what the error message tells you: don’t mutate arrays, use a functional style (`map`, comprehensions, etc).

It is difficult to help more without a concrete, self-contained example.

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

Also, see

[https://fluxml.ai/Zygote.jl/latest/utils/#Zygote.Buffer](https://fluxml.ai/Zygote.jl/latest/utils/#Zygote.Buffer)

---

_[View the full topic](https://discourse.julialang.org/t/help-with-gradient/33943)._
