MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / build

Method build

src/framework/modules/recurrent_modules.cpp:218–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216 merged.reserve((steps.size() + 1) / 2);
217 for (size_t i = 0; i < steps.size(); i += 2) {
218 merged.push_back(i + 1 < steps.size() ? concat_rows.build(ctx, steps[i], steps[i + 1]) : steps[i]);
219 }
220 steps = std::move(merged);
221 }
222 return {steps.front(), hidden, cell};
223 }
224
225 auto sequence = steps[0];
226 for (int64_t t = 1; t < frames; ++t) {
227 sequence = concat_rows.build(ctx, sequence, steps[static_cast<size_t>(t)]);
228 }
229 return LSTMSequenceOutputs{sequence, hidden, cell};
230}
231
232} // namespace
233
234LSTMCellModule::LSTMCellModule(LSTMCellConfig config) : config_(config) {
235 if (config_.input_size <= 0 || config_.hidden_size <= 0) {
236 throw std::runtime_error("LSTMCellConfig dimensions must be positive");
237 }
238}
239
240const LSTMCellConfig & LSTMCellModule::config() const noexcept {
241 return config_;
242}

Callers 3

gate_sliceFunction · 0.45
build_lstm_sequenceFunction · 0.45

Calls 7

validate_rank_betweenFunction · 0.85
validate_shapeFunction · 0.85
validate_weight_shapesFunction · 0.85
LinearModuleClass · 0.85
build_lstm_sequenceFunction · 0.85
ConcatModuleClass · 0.85

Tested by

no test coverage detected