Struct EvalContext

Struct Documentation

struct EvalContext

EvalContext is the shared state for all Actions executed during an AMS evaluation pipeline. It contains user-provided tensors, model references, layout handlers, and intermediate storage.

This structure intentionally contains no behavior. All semantics are implemented by Actions operating on EvalContext.

Public Functions

EvalContext() = default
inline EvalContext(TensorBundle inputs, TensorBundle inouts, TensorBundle outputs, const ams::ml::InferenceModel *model, LayoutTransform *layout, std::optional<float> threshold)

Public Members

TensorBundle Inputs

Pure inputs (not modified)

TensorBundle Inouts

Tensors modified in-place by evaluation.

TensorBundle Outputs

Pure outputs written by the model or fallback.

const ams::ml::InferenceModel *Model = nullptr

Surrogate model, may be null.

LayoutTransform *Layout = nullptr

Layout transform handler.

std::optional<float> Threshold

Uncertainty threshold (if used)

at::Tensor ModelInput

Model-side input tensor.

at::Tensor ModelOutput

Model-side output tensor.

std::optional<at::Tensor> Uncertainties

Uncertainty predictions if the model produces them.

std::vector<int64_t> FallbackIndices

Samples requiring fallback.