Skip to main content

ClikaRT::nn::ModuleList

class

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

An indexed list of modules registered under their positions ("0", "1", ...), so a checkpoint names their weights layers.3.weight. A list has no forward of its own: the owner iterates it.

Member functions​

ModuleList()​

ModuleList() =default

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

ModuleList(shared_ptr<Ms>...)​

template <``class... Ms``>
explicit ModuleList(std::shared_ptr<Ms>... modules)

Constructs from modules, appended in argument order.

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

push_back()​

ModuleList& push_back(std::shared_ptr<Module> module)

Appends module under the next position.

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

size()​

std::size_t size() const

The number of modules.

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

empty()​

bool empty() const

True when the list holds no module.

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

operator[]()​

const std::shared_ptr<Module>& operator[](std::size_t index) const

The module at index (unchecked, like a vector).

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

modules()​

const std::vector<std::shared_ptr<Module>>& modules() const

The modules in order.

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

begin()​

std::vector<std::shared_ptr<Module>>::const_iterator begin() const

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

end()​

std::vector<std::shared_ptr<Module>>::const_iterator end() const

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