#include "regularizer.h" namespace paddle { namespace optimizer { template Regularizer* Regularizer::create(const std::string& config) { paddle::OptimizerConfig config; Regularizer* r; if (config.regularizer_type() == paddle::OptimizerConfig_RegularizerType_L1) { r = new L1Regularizer(config); } else if (config.regularizer_type() == paddle::OptimizerConfig_RegularizerType_L2) { r = new L2Regularizer(config); break; } return r; } template class L1Regularizer; template class L1Regularizer; template class L2Regularizer; template class L2Regularizer; } // namespace optimizer } // namespace paddle