Template Struct AdditiveModel¶
Defined in File cost_model.hpp
Nested Relationships¶
Nested Types¶
Struct Documentation¶
-
template<typename CostFn, typename FootprintFn>
struct AdditiveModel¶ Additive single-term cost model (FLOPs or operand storage size).
Implements the additive single-term DP, factored into the CostModel hooks driven by run_single_term_opt. The per-contraction cost is supplied by
CostFn(e.g. flops_counter or memsize_counter); a per-intermediate footprint penalty, volatile replay weighting, and subnet common-subexpression elimination (CSE) are all handled by the hooks.- Template Parameters:
CostFn – A callable
(lhs, rhs, result) -> double.FootprintFn – A callable
(result) -> double.
Public Functions
-
template<typename TIdxs>
inline Context build_context(TensorNetwork const &network, TIdxs const &tidxs) const¶
-
inline void relax(Context &ctx, size_t n, size_t lp, size_t rp, State const &lp_st, State const &rp_st, State &acc) const¶
-
inline EvalSequence reconstruct(Context const&, container::vector<State> const &st) const¶
Public Members
-
FootprintFn footprint_fn¶
-
size_t volatile_mask¶
-
double volatile_weight¶
-
double footprint_weight¶
-
bool subnet_cse¶
-
bool prune_outer_products = true¶
Prune disconnected (outer-product) subsets from the DP (see OptimizeOptions::prune_outer_products). Default true.
-
struct Context¶
Precomputed tables AND mutable DP scratch, built once by build_context.
Public Members