ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::train::Backend Class Reference

#include <Backend.h>

Collaboration diagram for onert::backend::train::Backend:

Public Member Functions

 Backend ()
 
std::shared_ptr< IConfigconfig () const override
 
std::unique_ptr< onert::backend::BackendContextnewContext (ContextData &&data) const override
 
std::unique_ptr< backend::train::TrainableBackendContextnewContext (backend::train::TrainableContextData &&tdata) const override
 
- Public Member Functions inherited from onert::backend::Backend
virtual ~Backend ()=default
 
- Public Member Functions inherited from onert::backend::train::ITrainableBackend
virtual ~ITrainableBackend ()=default
 

Detailed Description

Definition at line 39 of file Backend.h.

Constructor & Destructor Documentation

◆ Backend()

onert::backend::train::Backend::Backend ( )
inline

Definition at line 42 of file Backend.h.

42: _config{std::make_shared<Config>()} {}

Member Function Documentation

◆ config()

std::shared_ptr< IConfig > onert::backend::train::Backend::config ( ) const
inlineoverridevirtual

Implements onert::backend::Backend.

Definition at line 44 of file Backend.h.

44{ return _config; }

◆ newContext() [1/2]

std::unique_ptr< backend::train::TrainableBackendContext > onert::backend::train::Backend::newContext ( backend::train::TrainableContextData &&  tdata) const
inlineoverridevirtual

Implements onert::backend::train::ITrainableBackend.

Definition at line 52 of file Backend.h.

53 {
54 const auto &tgraph = *tdata.tgraph;
55 auto optimizer = createOptimizer(tdata.optim_info);
56 auto tr = std::make_shared<TensorRegistry>();
57 auto tb = std::make_shared<TensorBuilder>(tr, optimizer.get());
58 auto tdata_ptr = std::make_unique<backend::train::TrainableContextData>(std::move(tdata));
59 auto context = std::make_unique<train::BackendContext>(this, std::move(tdata_ptr), tr, tb,
60 std::move(optimizer));
61
62 context->kernel_gen = std::make_shared<train::KernelGenerator>(
63 tgraph, tr, context->external_context(), context->optimizer());
64 return context;
65 }
std::unique_ptr< exec::train::optimizer::Optimizer > createOptimizer(const ir::train::OptimizerInfo &optim_info)
Definition Optimizers.h:33

References onert::backend::train::createOptimizer().

◆ newContext() [2/2]

std::unique_ptr< onert::backend::BackendContext > onert::backend::train::Backend::newContext ( ContextData &&  data) const
inlineoverridevirtual

Implements onert::backend::Backend.

Definition at line 46 of file Backend.h.

47 {
48 return std::make_unique<DummyBackendContext>(this, std::move(data));
49 }

The documentation for this class was generated from the following file: