Apache SINGA
A distributed deep learning platform .
|
factory template to generate class (or a sub-class) object based on id. More...
#include <factory.h>
Public Member Functions | |
void | Register (const std::string id, std::function< T *(void)> func) |
Register functions to create user defined classes. More... | |
T * | Create (const std::string id) |
create a layer instance by providing its type More... | |
factory template to generate class (or a sub-class) object based on id.
T * Factory< T >::Create | ( | const std::string | id | ) |
create a layer instance by providing its type
type | the identifier of the layer to be created |
void Factory< T >::Register | ( | const std::string | id, |
std::function< T *(void)> | func | ||
) |
Register functions to create user defined classes.
This function is called by the REGISTER_FACTORY macro.
id | identifier of the creating function/class |
create_function | a function that creates a layer instance |