-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to parse local Jacobian sparsity pattern #216
Comments
Shorter MWE: julia> using SparseConnectivityTracer
julia> function f(x::AbstractVector)
n = length(x)
ret = []
for i in 1:n-1
append!(ret, abs2(x[i + 1]) - abs2(x[i]) + abs2(x[n - i]) - abs2(x[n - i + 1]))
end
return ret
end
f (generic function with 1 method)
julia> x = randn(10);
julia> jacobian_sparsity(f, x, TracerLocalSparsityDetector())
ERROR: MethodError: no method matching jacobian_pattern_to_mat(::Vector{SparseConnectivityTracer.Dual{Float64, SparseConnectivityTracer.GradientTracer{…}}}, ::Vector{Any})
The function `jacobian_pattern_to_mat` exists, but no method is defined for this combination of argument types.
Closest candidates are:
jacobian_pattern_to_mat(::AbstractArray{D}, ::AbstractArray{<:Real}) where {P, T<:SparseConnectivityTracer.GradientTracer, D<:SparseConnectivityTracer.Dual{P, T}}
@ SparseConnectivityTracer ~/Developer/SparseConnectivityTracer.jl/src/trace_functions.jl:122
jacobian_pattern_to_mat(::AbstractArray{T}, ::AbstractArray{<:Real}) where T<:SparseConnectivityTracer.GradientTracer
@ SparseConnectivityTracer ~/Developer/SparseConnectivityTracer.jl/src/trace_functions.jl:103
Stacktrace:
[1] _local_jacobian_sparsity(f::Function, x::Vector{Float64}, ::Type{SparseConnectivityTracer.GradientTracer{SparseConnectivityTracer.IndexSetGradientPattern{Int64, BitSet}}})
@ SparseConnectivityTracer ~/Developer/SparseConnectivityTracer.jl/src/trace_functions.jl:91
[2] jacobian_sparsity(f::Function, x::Vector{Float64}, ::TracerLocalSparsityDetector{SparseConnectivityTracer.GradientTracer{…}, SparseConnectivityTracer.HessianTracer{…}})
@ SparseConnectivityTracer ~/Developer/SparseConnectivityTracer.jl/src/adtypes_interface.jl:149
[3] top-level scope
@ REPL[15]:1
Some type information was truncated. Use `show(err)` to see complete types. |
Looks like this was just an issue of SCT's type annotations being too strict. |
Yeah, the reason causing this error is the type SparseConnectivityTracer.jl/src/trace_functions.jl Lines 103 to 126 in e6d357b
|
Fixed in SCT |
Reopening from JuliaDiff/DifferentiationInterface.jl#641:
fails with the stack trace
The text was updated successfully, but these errors were encountered: