Open prbzrg opened 2 years ago
I think that's due to the Jacobian being an ill-defined notion when your function is not vector-to-vector. Many backends define it by flattening, we probably should do that in AD too
Hi, I am having a similar issue with the vcat
function, it may also be related to a few issues I've seen raised.
I think I'm following the docs here but:
import AbstractDifferentiation as AD, Zygote
backend = AD.ZygoteBackend()
args = (1, 2)
# This works fine
jac_from_ad = AD.jacobian(backend, (x, y) -> vcat(x,y), args...)
jac_from_zyg = Zygote.jacobian(vcat, args...)
@assert jac_from_ad == jac_from_zyg
# But this does not evaluate
failed = AD.jacobian(backend, vcat, args...)