Skip to content

Commit

Permalink
Apply @mofeing suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sergio Sánchez Ramírez <[email protected]>
  • Loading branch information
jofrevalles and mofeing authored Nov 3, 2023
1 parent 6962242 commit a679316
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Optimizers/KaHyPar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ using KaHyPar
imbalance::Float32 = 0.03
stop::Function = <=(2) length Base.Fix1(getfield, :args)
configuration::Union{Nothing,Symbol,String} = nothing
edge_scaler::Function = (ind_size) -> 1000 * (Int round log2)(ind_size)
vertex_scaler::Function = (prod_size) -> 1000 * (Int round log2)(prod_size)
edge_scaler::Function = *(1000) Int round log2
vertex_scaler::Function = *(1000) Int round log2
end

function EinExprs.einexpr(config::HyPar, path)
Expand All @@ -23,7 +23,7 @@ function EinExprs.einexpr(config::HyPar, path)
incidence_matrix = sparse(I, J, V)

# NOTE indices in `inds` should be in the same order as unique indices appear by iterating on `path.args` because `∪` retains order
edge_weights = map(ind -> (config.edge_scaler Base.Fix1(size, path))(ind), inds)
edge_weights = map(config.edge_scaler Base.Fix1(size, path), inds)
vertex_weights = map(config.vertex_scaler length, path.args)

hypergraph = KaHyPar.HyperGraph(incidence_matrix, vertex_weights, edge_weights)
Expand Down

0 comments on commit a679316

Please sign in to comment.