Class LayoutTransform

Inheritance Relationships

Derived Type

Class Documentation

class LayoutTransform

Abstract base class describing how AMS transforms application-level data (Inputs, Inouts, Outputs) into contiguous model inputs and vice versa.

  • pack() produces the tensor that is fed into the surrogate model.

  • unpack() receives the model output (an IValue that may contain multiple tensors) and maps it back into Outputs, Inouts, and optionally Uncertainties.

The AMS pipeline never assumes any particular layout; all shape and packing logic lives in concrete LayoutTransform implementations.

Subclassed by ams::PointwiseConcatTransform

Public Functions

virtual ~LayoutTransform() = default
virtual AMSExpected<IndexMap> pack(const TensorBundle &Inputs, const TensorBundle &InOuts, at::Tensor &ModelInput) = 0
virtual AMSStatus unpack(const torch::jit::IValue &ModelOutput, TensorBundle &Outs, TensorBundle &InOuts, std::optional<at::Tensor> &Uncertainties) = 0
virtual const char *name() const noexcept = 0