Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NonconvexUtils"
uuid = "c48e48a2-1f5e-44ff-8799-c8e168d11d1b"
authors = ["Mohamed Tarek <[email protected]> and contributors"]
version = "0.4.3"
version = "0.4.4"

[deps]
AbstractDifferentiation = "c29ec348-61ec-40c8-8164-b8c60e9d9f3d"
Expand All @@ -14,6 +14,7 @@ MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
NonconvexCore = "035190e5-69f1-488f-aaab-becca2889735"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

Expand All @@ -27,6 +28,7 @@ LinearMaps = "3"
MacroTools = "0.5"
NonconvexCore = "1.1"
SparseDiffTools = "2"
SymbolicUtils = "1.5"
Symbolics = "5"
Zygote = "0.5, 0.6"
julia = "1"
Expand Down
4 changes: 4 additions & 0 deletions src/sparse_forwarddiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ struct UnflattennedFunction{F1,F2,V,U} <: Function
flatteny::Bool
end
(f::UnflattennedFunction)(x...) = f.f(x...)
function NonconvexCore.tovecfunc(f::UnflattennedFunction, ::AbstractVector{<:Real}; flatteny = true)
@assert flatteny == f.flatteny
return f.flat_f, f.v, f.unflatten
end
function NonconvexCore.tovecfunc(f::UnflattennedFunction, x...; flatteny = true)
@assert flatteny == f.flatteny
return f.flat_f, f.v, f.unflatten
Expand Down