Zygote for Dictionaries does not work (specifically the Pullback)

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:

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:

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?

1 Like