mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Update module add layer
This commit is contained in:
@@ -5,8 +5,16 @@
|
|||||||
using namespace CUDANet;
|
using namespace CUDANet;
|
||||||
|
|
||||||
void Module::addLayer(const std::string& name, Layers::SequentialLayer* layer) {
|
void Module::addLayer(const std::string& name, Layers::SequentialLayer* layer) {
|
||||||
layers.push_back({ name, layer });
|
Module* module = dynamic_cast<Module*>(layer);
|
||||||
layerMap[name] = layer;
|
|
||||||
|
if (module != nullptr) {
|
||||||
|
layers.push_back({ name, module });
|
||||||
|
for (const auto& moduleLayer : module->getLayers()) {
|
||||||
|
layerMap[moduleLayer.first] = moduleLayer.second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Layers::SequentialLayer* Module::getLayer(const std::string& name) {
|
Layers::SequentialLayer* Module::getLayer(const std::string& name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user