53 {
54 const auto &tgraph = *tdata.tgraph;
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)