# Map! for Zygote.Buffer

**URL:** <https://discourse.julialang.org/t/map-for-zygote-buffer/119007>\
**Category:** General Usage\
**Created:** [September 3, 2024, 8:19pm UTC](https://discourse.julialang.org/t/map-for-zygote-buffer/119007 "2024-09-03T20:19:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [September 3, 2024, 8:19pm UTC](https://discourse.julialang.org/t/map-for-zygote-buffer/119007/1 "2024-09-03T20:19:16Z")

</div>

`map!(f,y,x)` wants `y::AbstractArray` which means it doesn’t work on `Zygote.Buffer`.

I want to use `map!` and I’m wondering if that constraint can be removed to solve the problem.

```julia
using Zygote
julia> let xs = rand(5), ys = Zygote.Buffer(xs)
           map!(exp, ys, xs)
       end
ERROR: MethodError: no method matching map!(::typeof(exp), ::Zygote.Buffer{Float64, Vector{Float64}}, ::Vector{Float64})

Closest candidates are:
  map!(::Any, ::GPUArraysCore.AnyGPUArray, ::AbstractArray...)
   @ GPUArrays ~/.julia/packages/GPUArrays/qt4ax/src/host/broadcast.jl:120
  map!(::F, ::AbstractArray, ::AbstractArray, ::AbstractArray) where F
   @ Base abstractarray.jl:3319
  map!(::F, ::AbstractArray, ::AbstractArray) where F
   @ Base abstractarray.jl:3276

```
