# Understanding Flux and Zygote : Mutating errors not supported and a new error

**URL:** <https://discourse.julialang.org/t/understanding-flux-and-zygote-mutating-errors-not-supported-and-a-new-error/51860>\
**Category:** General Usage\
**Tags:** flux, zygote\
**Created:** [December 15, 2020, 10:55am UTC](https://discourse.julialang.org/t/understanding-flux-and-zygote-mutating-errors-not-supported-and-a-new-error/51860 "2020-12-15T10:55:41Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)\
**Post date:** [December 15, 2020, 1:12pm UTC](https://discourse.julialang.org/t/understanding-flux-and-zygote-mutating-errors-not-supported-and-a-new-error/51860/4 "2020-12-15T13:12:03Z")

</div>

The `sum(f, x)` pattern may be a bit of a waste, as IIRC Zygote turns it back into `sum(f.(x))` (whereas normally it would save allocating `f.(x)`).

> [@kadir-gunel](#):
>
> Probably ` istft` can be converted to accept 3-array. So you suggest to convert the x,y and y^ directly and obtain new values inside new variable?

I think so? I mean I suggest working with “solid” arrays as much as possible, rather than making slices. So instead of (or in addition to) `istft(x::AbstractMatrix)` you define `istft(xs::AbstractArray{T,3})` with every step inside this function keeping track of one more dimension.

---

_[View the full topic](https://discourse.julialang.org/t/understanding-flux-and-zygote-mutating-errors-not-supported-and-a-new-error/51860)._
