Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onert-micro] Add training into RuntimeModule #11547

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions onert-micro/luci-interpreter/src/core/RuntimeModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
#include "core/RuntimeGraph.h"
#include "luci_interpreter/core/reader/CircleMicroReader.h"

#ifdef ENABLE_TRAINING
#include "luci_interpreter/TrainableWeightStorage.h"
#include "TrainingGraph.h"
#include "core/RuntimeGraph.h"
#endif // ENABLE_TRAINING

#include <memory>
#include <vector>

Expand All @@ -34,11 +40,24 @@ using BaseRuntimeGraph = RuntimeGraph;
using MemoryManager = SimpleMemoryManager;
#endif // USE_STATIC_ALLOC

#ifdef ENABLE_TRAINING
namespace training
{

class TrainingModule;

} // namespace training
#endif // ENABLE_TRAINING

class RuntimeModule
{
public:
RuntimeModule() = default;

#ifdef ENABLE_TRAINING
friend class training::TrainingModule;
#endif // ENABLE_TRAINING

void addGraph(MemoryManager *memory_manager)
{
_graphs.emplace_back(memory_manager, &_circle_reader, this,
Expand All @@ -59,6 +78,10 @@ class RuntimeModule
std::vector<BaseRuntimeGraph> _graphs;

CircleReader _circle_reader;

#ifdef ENABLE_TRAINING
std::unique_ptr<training::TrainableWeightStorage> _storage;
#endif // ENABLE_TRAINING
};

} // namespace luci_interpreter
Expand Down