Skip to main content

dl::WeightsVariant

dl::WeightsVariant

JSON-serializable weights variant for multi-batch-size model loading. More…

#include <RuntimeModelSpec.hpp>

Public Attributes

Name
std::string path
int batch_size
std::optional< std::string > label
std::optional< std::string > backend

Detailed Description

struct dl::WeightsVariant;

JSON-serializable weights variant for multi-batch-size model loading.

Each variant specifies a weights file and the batch size it was compiled for. The widget auto-selects the variant matching the active batch size.

JSON example: ```json

“weights_variants”: [ { “path”: “model_batch1.pt2”, “batch_size”: 1, “label”: “recurrent” }, { “path”: “model_batch8.pt2”, “batch_size”: 8, “label”: “batched” }]


## Public Attributes Documentation

### variable path

```cpp
std::string path;

Path to weights file

variable batch_size

int batch_size = 1;

Batch size this variant was compiled for

variable label

std::optional< std::string > label;

Optional human-readable label

variable backend

std::optional< std::string > backend;

Optional backend override


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