Add GraphProperties and property caching
This commit is contained in:
@ -40,6 +40,9 @@ function apply_operation!(graph::DAG, operation::NodeFusion)
|
||||
operation.input[2],
|
||||
operation.input[3],
|
||||
)
|
||||
|
||||
graph.properties += GraphProperties(diff)
|
||||
|
||||
return AppliedNodeFusion(operation, diff)
|
||||
end
|
||||
|
||||
@ -52,6 +55,9 @@ Return an [`AppliedNodeReduction`](@ref) object generated from the graph's [`Dif
|
||||
"""
|
||||
function apply_operation!(graph::DAG, operation::NodeReduction)
|
||||
diff = node_reduction!(graph, operation.input)
|
||||
|
||||
graph.properties += GraphProperties(diff)
|
||||
|
||||
return AppliedNodeReduction(operation, diff)
|
||||
end
|
||||
|
||||
@ -64,6 +70,9 @@ Return an [`AppliedNodeSplit`](@ref) object generated from the graph's [`Diff`](
|
||||
"""
|
||||
function apply_operation!(graph::DAG, operation::NodeSplit)
|
||||
diff = node_split!(graph, operation.input)
|
||||
|
||||
graph.properties += GraphProperties(diff)
|
||||
|
||||
return AppliedNodeSplit(operation, diff)
|
||||
end
|
||||
|
||||
@ -127,6 +136,9 @@ function revert_diff!(graph::DAG, diff::Diff)
|
||||
for edge in diff.removedEdges
|
||||
insert_edge!(graph, edge.edge[1], edge.edge[2], false)
|
||||
end
|
||||
|
||||
graph.properties -= GraphProperties(diff)
|
||||
|
||||
return nothing
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user