fix layer_factory.cpp bug: there should be no ifdefs
Merge pull request #993 from Yangqing/sweep

fix layer_factory.cpp bug: there should be no ifdefs