consolidate duplicate code
authorYangqing Jia <jiayq84@gmail.com>
Sun, 28 Sep 2014 22:46:03 +0000 (15:46 -0700)
committerYangqing Jia <jiayq84@gmail.com>
Mon, 29 Sep 2014 00:45:23 +0000 (17:45 -0700)
include/caffe/layer_factory.hpp

index 24b4276..5f44d97 100644 (file)
@@ -104,10 +104,7 @@ class LayerRegisterer {
   Layer<Dtype>* Creator_##clsname(const LayerParameter& param) {               \
     return new clsname<Dtype>(param);                                          \
   }                                                                            \
-  static LayerRegisterer<float> g_creator_f_##clsname(                         \
-      LayerParameter_LayerType_##type, Creator_##clsname<float>);              \
-  static LayerRegisterer<double> g_creator_d_##clsname(                        \
-      LayerParameter_LayerType_##type, Creator_##clsname<double>)
+  REGISTER_LAYER_CREATOR(type, Creator_##clsname)
 
 // A function to get a specific layer from the specification given in
 // LayerParameter. Ideally this would be replaced by a factory pattern,