Skip to content

Jacobian of in-place functions in presence of undefined references #436

Open
@lcontento

Description

@lcontento

The method

ForwardDiff.jacobian(f!, y::AbstractArray, x::AbstractArray)

throws UndefRefError when y contains undefined references.
For example,

using ForwardDiff
f!(y, x) = copy!(y, x)
x0 = BigFloat[1.0, 1.0]
ForwardDiff.jacobian(f!, similar(x0), x0)

In particular, this affects the NLsolve package, e.g.,

using NLsolve
nlsolve(f!, x0, autodiff=:forward)

Since I think the reasonable expectation is that only the type and shape of the y array are going to be used in ForwardDiff.jacobian, I am reporting this here. If you do not think that the undefined case should be taken in account, I will post an issue for NLsolve instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions