Skip to main content

dl::TensorSlotDescriptor

dl::TensorSlotDescriptor

Describes one named tensor input or output of a model. More…

#include <TensorSlotDescriptor.hpp>

Public Functions

Name
int64_t numElements() const
Compute the total number of elements in one slot (excluding batch).
bool hasSequenceDim() const
Check if this slot has a sequence dimension.

Public Attributes

Name
std::string name
e.g. “encoder_image”
std::vector< int64_t > shape
e.g. {3, 256, 256} (excluding batch)
std::string description
Human-readable description.
std::string recommended_encoder
e.g. “ImageEncoder” — hint for UI
std::string recommended_decoder
e.g. “TensorToMask2D”
bool is_static
If true, user sets once (memory frames).
bool is_boolean_mask
If true, values are 0/1 flags.
TensorDType dtype
int sequence_dim

Detailed Description

struct dl::TensorSlotDescriptor;

Describes one named tensor input or output of a model.

Each slot has a shape (excluding the leading batch dimension), a name, and hints for encoders/decoders that the UI can use for auto-configuration.

Public Functions Documentation

function numElements

inline int64_t numElements() const

Compute the total number of elements in one slot (excluding batch).

function hasSequenceDim

inline bool hasSequenceDim() const

Check if this slot has a sequence dimension.

Public Attributes Documentation

variable name

std::string name;

e.g. “encoder_image”

variable shape

std::vector< int64_t > shape;

e.g. {3, 256, 256} (excluding batch)

variable description

std::string description;

Human-readable description.

variable is_static

bool is_static = false;

If true, user sets once (memory frames).

variable is_boolean_mask

bool is_boolean_mask = false;

If true, values are 0/1 flags.

variable dtype

TensorDType dtype = TensorDType::Float32;

Expected tensor dtype. Default is Float32. Use Byte (uint8) for image inputs that the model normalizes internally.

variable sequence_dim

int sequence_dim = -1;

Optional sequence dimension index within [shape](/api_generated/Classes/structdl_1_1TensorSlotDescriptor.md#variable-shape). When >= 0, this axis represents a sequence of frames (e.g., memory slots). The model internally consumes the full sequence; the UI maps each static-input entry to a position along this axis. When < 0 (default), no sequence dimension — single frame per slot.


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