Template Function sequant::make_evaluator¶
Defined in File eval.hpp
Function Documentation¶
-
template<Trace EvalTrace = Trace::Default, class F, class ScopeGuardFactory = make_no_scope_guard>
auto sequant::make_evaluator(BatchPolicy const &policy, F yielder, ScopeGuardFactory make_scope_guard = {}, PeakSink peak = nullptr)¶ Builds a batched custom evaluator (see make_batched_custom_evaluator) from a
policyobject, lifting the policy’s canonical Tensor-based volatile-leaf predicate to the EvalNode predicate the batched evaluator expects.Exactly equivalent to calling make_batched_custom_evaluator with:
target_batch_size = policy.batch_target_size
accept = policy.is_batchable_index() (derived role union)
make_scope_guard = make_scope_guard (forwarded)
is_volatile = EvalNode lift of policy.is_volatile_leaf: n.leaf() && n->is_tensor() && policy.is_volatile_leaf(n->as_tensor()) (when policy.is_volatile_leaf is empty, no node is volatile)
- Template Parameters:
EvalTrace – trace level forwarded to make_batched_custom_evaluator (same semantics and same rationale — see there).
- Parameters:
policy – BatchPolicy carrying the three batchability predicates.
yielder – The leaf evaluator (captured and forwarded).
make_scope_guard – Optional scope-guard factory (same semantics as in make_batched_custom_evaluator; defaults to make_no_scope_guard).
peak – Optional PeakSink (same semantics as in make_batched_custom_evaluator); defaults to null (no folding). Note:
peakis the 4th positional argument, aftermake_scope_guard— a caller who wants the sink but not a custom scope guard must still pass the scope-guard factory explicitly (e.g.make_evaluator(policy, leaf, make_no_scope_guard{}, &sink)); passing&sinkin the 3rd slot silently binds it tomake_scope_guard(via template deduction) and leavespeaknull.