Implement model destructor

This commit is contained in:
2024-04-14 00:05:57 +02:00
parent 53c976733b
commit b20ade27d8

View File

@@ -25,7 +25,13 @@ Model::Model(const Model& other)
outputLayer = new Layers::Output(*other.outputLayer);
}
Model::~Model(){};
Model::~Model(){
delete inputLayer;
delete outputLayer;
for (auto layer : layers) {
delete layer;
}
};
float* Model::predict(const float* input) {
float* d_input = inputLayer->forward(input);