Skip to content

Error for quadratic function with hessian_reverse #1414

@tmigot

Description

@tmigot
Zygote.hessian_reverse(x -> x[1] * x[2]^2 + x[1]^2 * x[2], [-1.2; 1.0])

and I got the following error

ERROR: Need an adjoint for constructor Zygote.OneElement{Float64, 1, Tuple{Int64}, Tuple{Base.OneTo{Int64}}}. Gradient is of type Vector{Float64}
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] (::Zygote.Jnew{Zygote.OneElement{Float64, 1, Tuple{Int64}, Tuple{Base.OneTo{Int64}}}, Nothing, false})(Δ::Vector{Float64})
    @ Zygote .julia\packages\Zygote\SuKWp\src\lib\lib.jl:330
  [3] (::Zygote.var"#2176#back#309"{Zygote.Jnew{Zygote.OneElement{Float64, 1, Tuple{Int64}, Tuple{Base.OneTo{Int64}}}, Nothing, false}})(Δ::Vector{Float64})
    @ Zygote .julia\packages\ZygoteRules\OgCVT\src\adjoint.jl:71
  [4] Pullback
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    second orderzygote over zygote, or otherwise

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions