Template Function sequant::opt::single_term_opt¶
Defined in File single_term.hpp
Function Documentation¶
-
template<ObjectiveFunction Metric = ObjectiveFunction::DenseFLOPs, has_index_extent IdxToSz>
ExprPtr sequant::opt::single_term_opt(Product const &prod, IdxToSz &&idxsz, bool subnet_cse = false, CostParams const &cost = {}, container::vector<NodeBatchAnnotation> *out_axes = nullptr)¶ Note
prodis assumed to consist of only Tensor expressionsNote
The remaining parameters (
subnet_cse,cost) are forwarded verbatim to the detail single_term_opt overload; see it for their semantics. All batching config (contracted/external role predicates,batch_target_size,inner_pow,batch_persistent_only) lives on CostParams.- Template Parameters:
Metric – Objective function (DenseFLOPs by default; DenseSize minimizes total operand storage rather than flops; DenseSpaceTime minimizes peak memory over the evaluation schedule — see ObjectiveFunction).
- Parameters:
prod – Product to be optimized.
idxsz – An invocable object that maps an Index object to size.
out_axes – When non-null and
Metric== ObjectiveFunction::DenseSpaceTimeBatched, filled with the per-node sliced-sets of the returned Product tree’s contraction nodes, in the same left-first post-order the nested Product below is built in (so(*out_axes)[j] annotates the j-th Product node formed by the-1-handlingarm of the loop below). Left empty ifprodhas fewer than 3 factors (no factorization is performed) or ifMetric!= DenseSpaceTimeBatched.
- Returns:
Parenthesized product expression.