ForwardDiff2.jl
ForwardDiff2.jl copied to clipboard
Hessian Test Failures
https://github.com/YingboMa/ForwardDiff2.jl/blob/master/test/api.jl#L56
using Test
using ForwardDiff2: D, DI, ForwardDiff2
using StaticArrays
using LinearAlgebra
julia> let
dh1 = D(DI(x->x[1]^x[2] + x[3]^3 + x[3]*x[2]*x[1]))
dh2 = D(D(x->x[1]^x[2] + x[3]^3 + x[3]*x[2]*x[1]))
for dh in (dh1, dh2,)
@test dh(@SVector[1,2,3]) * I == @SMatrix [2 4 2; 4 0 1; 2 1 18.0]
# @test dh([1,2,3]) * I == [2 4 2; 4 0 1; 2 1 18.0]
# @test dh([1,2,3]) * @SVector([1, 2, 3]) == @SVector [16, 7, 58.0]
end
end
Error During Test at REPL[9]:5
Test threw exception
Expression: dh(#= REPL[9]:5 =# @SVector([1, 2, 3])) * I == #= REPL[9]:5 =# @SMatrix([2 4 2; 4 0 1; 2 1 18.0])
StackOverflowError:
Stacktrace:
[1] log(::ForwardDiff2.Dual{ForwardDiff2.Tag{Nothing},Float64,SArray{Tuple{3},Int64,1,3}}) at ./special/log.jl:395 (repeats 79984 times)
ERROR: There was an error during testing
(@v1.4) pkg> st ForwardDiff2 Cassette
Status `~/.julia/environments/v1.4/Project.toml`
[7057c7e9] Cassette v0.3.1 [`~/.julia/dev/Cassette`]
[994df76e] ForwardDiff2 v0.2.2 [`~/.julia/dev/ForwardDiff2`]
julia> versioninfo()
Julia Version 1.4.0
Commit b8e9a9ecc6* (2020-03-21 16:36 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: AMD Ryzen 5 2600 Six-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, znver1)
Environment:
JULIA_NUM_THREADS = 6