Skip to content

Commit

Permalink
Make generic to other algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed Dec 10, 2024
1 parent 620da37 commit 180183e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/normalize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ function rescale(
end

function rescale(
alg::Algorithm"bp",
alg::Algorithm,
tn::AbstractITensorNetwork,
vs=collect(vertices(tn));
(cache!)=nothing,
cache_construction_kwargs=default_cache_construction_kwargs(alg, tn),
update_cache=isnothing(cache!),
cache_update_kwargs=default_cache_update_kwargs(cache!),
)
if isnothing(cache!)
cache! = Ref(BeliefPropagationCache(tn, group(v -> v, vertices(tn))))
cache! = Ref(cache(alg, tn; cache_construction_kwargs...))
end

if update_cache
Expand Down

0 comments on commit 180183e

Please sign in to comment.