Template Function sequant::make_evaluator

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 policy object, 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 &#8212; see there).

Parameters:
  • policyBatchPolicy 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: peak is the 4th positional argument, after make_scope_guard &#8212; 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 &sink in the 3rd slot silently binds it to make_scope_guard (via template deduction) and leaves peak null.