From 34bcc24f62c4c31639c4ab9d3d7feb70eaa6c885 Mon Sep 17 00:00:00 2001 From: dehann Date: Mon, 12 Dec 2022 21:29:48 -0800 Subject: [PATCH] oas skip grad on caching --- .../services/DispatchPackedConversions.jl | 12 ++++++++++-- src/services/FactorGraph.jl | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Serialization/services/DispatchPackedConversions.jl b/src/Serialization/services/DispatchPackedConversions.jl index bc812a73..ef7ac6d8 100644 --- a/src/Serialization/services/DispatchPackedConversions.jl +++ b/src/Serialization/services/DispatchPackedConversions.jl @@ -72,16 +72,23 @@ end ## """ - $(SIGNATURES) + $(SIGNATURES) + After deserializing a factor using decodePackedType, use this to completely rebuild the factor's CCW and user data. + +Notes: +- This function is likely to be used for cache heavy factors, e.g. `ObjectAffordanceSubcloud`. + Dev Notes: - TODO: We should only really do this in-memory if we can by without it (review this). +- TODO: needs testing """ function rebuildFactorMetadata!( dfg::AbstractDFG{SolverParams}, factor::DFGFactor, - neighbors = map(vId -> getVariable(dfg, vId), getNeighbors(dfg, factor)), + neighbors = map(vId -> getVariable(dfg, vId), getNeighbors(dfg, factor)); + _blockRecursionGradients::Bool=false ) # # Set up the neighbor data @@ -100,6 +107,7 @@ function rebuildFactorMetadata!( potentialused = fsd.potentialused, edgeIDs = fsd.edgeIDs, solveInProgress = fsd.solveInProgress, + _blockRecursion=_blockRecursionGradients ) # diff --git a/src/services/FactorGraph.jl b/src/services/FactorGraph.jl index 03fb09ae..7d8b8b39 100644 --- a/src/services/FactorGraph.jl +++ b/src/services/FactorGraph.jl @@ -717,11 +717,11 @@ function getDefaultFactorData( _blockRecursion::Bool = false, ) where {T <: AbstractFactor} # - + # prepare multihypo particulars # storeMH::Vector{Float64} = multihypo == nothing ? Float64[] : [multihypo...] mhcat, nh = parseusermultihypo(multihypo, nullhypo) - + # allocate temporary state for convolutional operations (not stored) userCache = preambleCache(dfg, Xi, usrfnc) ccw = _prepCCW( @@ -734,7 +734,7 @@ function getDefaultFactorData( _blockRecursion, userCache, ) - + # and the factor data itself return FunctionNodeData{typeof(ccw)}( eliminated,