lbann
lbann copied to clipboard
Prototype execution context
It could be useful to add a method like: virtual std::unique_ptr<execution_context> get_prototype_execution_context() const = 0;
Then in derived classes implement, e.g.,
std::unique_ptr<execution_context> sgd_training_algorithm::get_prototype_execution_context() const
{
return make_unique<sgd_execution_context>();
}
This way, users don't need to worry about knowing how to create compatible algorithms/contexts -- the system is able to provide them with the right context for the algorithm they choose.