|
Mila 0.13.48
Deep Neural Network Library
|
Capability interface for position-dependent unary operations. More...

Public Member Functions | |
| virtual | ~IPositionalDecode ()=default |
| virtual void | decode (const ITensor &input, ITensor &output, int position)=0 |
| Process a single token at an explicit sequence position. | |
Capability interface for position-dependent unary operations.
Implemented by operations whose mathematical output changes based on the token's absolute position in the sequence — e.g. positional embedding lookups (Lpe) and attention operations that index into a KV cache (GQA, MHA).
Operations that are position-agnostic (Linear, RmsNorm, SwiGLU, Residual) do not implement this interface — they use forward() for all modes.
|
virtualdefault |
|
pure virtual |
Process a single token at an explicit sequence position.
| input | Single-token input [B, 1, ...]. |
| output | Single-token output [B, 1, ...]. |
| position | Zero-based absolute sequence position. |
Implemented in Mila::Dnn::Compute::Cuda::Lpe::CudaLpeOp< TInput, TPrecision >, Mila::Dnn::Compute::Cuda::Lpe::CudaLpeOp< TensorDataType::INT32, TensorDataType::BF16 >, and Mila::Dnn::Compute::Cuda::Lpe::CudaLpeOp< TensorDataType::INT32, TensorDataType::FP32 >.