# Zygote for Dictionaries does not work (specifically the Pullback)

**URL:** <https://discourse.julialang.org/t/zygote-for-dictionaries-does-not-work-specifically-the-pullback/79222>\
**Category:** General Usage\
**Tags:** zygote\
**Created:** [April 8, 2022, 1:15pm UTC](https://discourse.julialang.org/t/zygote-for-dictionaries-does-not-work-specifically-the-pullback/79222 "2022-04-08T13:15:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eriklw](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@Eriklw](https://discourse.julialang.org/u/Eriklw)\
**Post date:** [April 8, 2022, 1:15pm UTC](https://discourse.julialang.org/t/zygote-for-dictionaries-does-not-work-specifically-the-pullback/79222/1 "2022-04-08T13:15:31Z")

</div>

The pullback function does not seem to work for dictionaries, while the gradient does.

Is that true or am I doing somthing wrong?

Example for the gradient:

```julia
inp = Dict{Any, Any}(1 => 1, 2 => 1)
f(x) = x[1] * x[2] * 5
gradient(f, inp)

```

works as intended and gives: (Dict{Any, Any}(2 =\> 5.0, 1 =\> 5.0),)

However for Pullbacks:

```julia
f(x) = Dict(1 => sin(x[1]), 2=> cos(x[2]))
inp = Dict(1 => 1, 2 => 1)
_, back = pullback(f,inp)
back(Dict(1 => 1, 2 => 1))

```

gives as a result: (nothing,)

What is going on?
