Skip to main content

dl::constraints

dl::constraints

Classes

Name
struct dl::constraints::BatchSizeConstraint
Computed batch-size constraint derived from model batch mode and active recurrent bindings.

Functions

Name
BatchSizeConstraint computeBatchSizeConstraint(dl::ModelInfo const & info, std::vector< MemoryFrameBinding > const & memory_frames)
Compute the batch-size constraint for a given model and memory frames.
std::vector< std::string > validDecodersForPostEncoder(dl::PostEncoderStepDescriptor const & params)
Return valid decoder alternatives for the current post-encoder params.

Functions Documentation

function computeBatchSizeConstraint

BatchSizeConstraint computeBatchSizeConstraint(
    dl::ModelInfo const & info,
    std::vector< MemoryFrameBinding > const & memory_frames
)

Compute the batch-size constraint for a given model and memory frames.

Parameters:

  • info Model display info (contains batch_mode).
  • memory_frames Session memory frame bindings.

Return: BatchSizeConstraint describing the allowed batch-size range.

Priority (most restrictive wins):

  • Active recurrent memory frames → min=1, max=1, forced_by_recurrent=true
  • Model RecurrentOnlyBatch or FixedBatch{1} → min=1, max=1, forced_by_recurrent=false
  • Model FixedBatch{N>1} → min=N, max=N, forced_by_recurrent=false
  • Model DynamicBatch → min/max from batch mode, forced_by_recurrent=false

function validDecodersForPostEncoder

std::vector< std::string > validDecodersForPostEncoder(
    dl::PostEncoderStepDescriptor const & params
)

Return valid decoder alternatives for the current post-encoder params.

Parameters:

  • params Post-encoder slot configuration from state or session.

Modules that collapse spatial dimensions (per [PostEncoderModuleRegistry](/api_generated/Classes/classdl_1_1PostEncoderModuleRegistry.md) metadata, i.e. [B,C,H,W] →[B,C]) restrict output decoders to [FeatureVectorDecoderParams](/api_generated/Classes/structdl_1_1FeatureVectorDecoderParams.md) only. module_key``"none" permits every decoder variant.


Updated on 2026-11-13 at 20:25:42 +0000