dl::PostEncoderPipeline
dl::PostEncoderPipeline
A composable, ordered sequence of [PostEncoderModule](/api_generated/Classes/classdl_1_1PostEncoderModule.md) operations. More…
#include <PostEncoderPipeline.hpp>
Inherits from dl::PostEncoderModule
Public Functions
| Name | |
|---|---|
| PostEncoderPipeline() =default | |
| void | add(std::unique_ptr< PostEncoderModule > module) Append a module to the end of the pipeline. |
| std::size_t | size() const Number of stages in the pipeline. |
| bool | empty() const Whether the pipeline contains no stages. |
| virtual std::string | name() const override Human-readable identifier for this module (e.g. “global_avg_pool”). |
| virtual at::Tensor | apply(at::Tensor const & features) const override Apply each module sequentially, passing the output of each as the input to the next. |
| virtual std::vector< int64_t > | outputShape(std::vector< int64_t > const & input_shape) const override Compute the output shape by propagating through each module’s [outputShape()]() in order. |
Additional inherited members
Public Functions inherited from dl::PostEncoderModule
| Name | |
|---|---|
| virtual | ~PostEncoderModule() =default |
Detailed Description
class dl::PostEncoderPipeline;A composable, ordered sequence of [PostEncoderModule](/api_generated/Classes/classdl_1_1PostEncoderModule.md) operations.
Each module’s output is fed as input to the next module in the pipeline. The pipeline is itself a [PostEncoderModule](/api_generated/Classes/classdl_1_1PostEncoderModule.md) so it can be stored wherever a single module is expected.
Example:
dl::PostEncoderPipeline pipeline;
pipeline.add(std::make_unique<dl::GlobalAvgPoolModule>());
// features [B,C,H,W] → [B,C] after pooling
auto result = pipeline.apply(features);Public Functions Documentation
function PostEncoderPipeline
PostEncoderPipeline() =defaultfunction add
void add(
std::unique_ptr< PostEncoderModule > module
)Append a module to the end of the pipeline.
Precondition: module must not be nullptr
function size
inline std::size_t size() constNumber of stages in the pipeline.
function empty
inline bool empty() constWhether the pipeline contains no stages.
function name
virtual std::string name() const overrideHuman-readable identifier for this module (e.g. “global_avg_pool”).
Reimplements: dl::PostEncoderModule::name
function apply
virtual at::Tensor apply(
at::Tensor const & features
) const overrideApply each module sequentially, passing the output of each as the input to the next.
Precondition: features must not be undefined.
Reimplements: dl::PostEncoderModule::apply
function outputShape
virtual std::vector< int64_t > outputShape(
std::vector< int64_t > const & input_shape
) const overrideCompute the output shape by propagating through each module’s [outputShape()]() in order.
Reimplements: dl::PostEncoderModule::outputShape
Updated on 2026-11-13 at 20:25:42 +0000