Skip to main content

ClikaRT::nn::ModuleDict

class

Header: ClikaRT/nn/containers.h
Inherits: ClikaRT::nn::Module

A named set of modules registered under their keys, in insertion order, so a checkpoint names their weights heads.cls.weight. A dict has no forward of its own: the owner looks a module up and calls it.

Types​

using Entry​

using Entry = std::pair<std::string, std::shared_ptr<Module>>

Declared in ClikaRT/nn/containers.h, line 161

Member functions​

ModuleDict()​

ModuleDict() =default

Declared in ClikaRT/nn/containers.h, line 163

insert()​

ModuleDict& insert(std::string name, std::shared_ptr<Module> module)

Adds module under name, or replaces the module already there (keeping its position). name is one path element: non-empty and without a ..

Declared in ClikaRT/nn/containers.h, line 168

contains()​

bool contains(std::string_view name) const

True when a module is registered under name.

Declared in ClikaRT/nn/containers.h, line 181

get()​

std::shared_ptr<Module> get(std::string_view name) const

The module under name, or an empty pointer when there is none.

Declared in ClikaRT/nn/containers.h, line 183

size()​

std::size_t size() const

The number of modules.

Declared in ClikaRT/nn/containers.h, line 188

empty()​

bool empty() const

True when the dict holds no module.

Declared in ClikaRT/nn/containers.h, line 190

entries()​

const std::vector<Entry>& entries() const

The (name, module) entries in insertion order.

Declared in ClikaRT/nn/containers.h, line 192