本文整理汇总了C++中LayerParameter::batch_norm_param方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerParameter::batch_norm_param方法的具体用法?C++ LayerParameter::batch_norm_param怎么用?C++ LayerParameter::batch_norm_param使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerParameter
的用法示例。
在下文中一共展示了LayerParameter::batch_norm_param方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetBatchNormLayer
shared_ptr<Layer<Dtype> > GetBatchNormLayer(const LayerParameter& param) {
BatchNormParameter_Engine engine = param.batch_norm_param().engine();
if (engine == BatchNormParameter_Engine_DEFAULT) {
engine = BatchNormParameter_Engine_CAFFE;
#ifdef USE_CUDNN
engine = BatchNormParameter_Engine_CUDNN;
#endif
}
if (engine == BatchNormParameter_Engine_CAFFE) {
return shared_ptr<Layer<Dtype> >(new BatchNormLayer<Dtype>(param));
#ifdef USE_CUDNN
} else if (engine == BatchNormParameter_Engine_CUDNN) {
return shared_ptr<Layer<Dtype> >(new CuDNNBatchNormLayer<Dtype>(param));
#endif
} else {
LOG(FATAL) << "Layer " << param.name() << " has unknown engine.";
}
}
示例2: GetBatchNormLayer
shared_ptr<Layer<Dtype> > GetBatchNormLayer(const LayerParameter& param) {
BatchNormParameter_Engine engine = param.batch_norm_param().engine();
if (engine == BatchNormParameter_Engine_DEFAULT) {
#if defined(USE_MKL2017_AS_DEFAULT_ENGINE)
engine = BatchNormParameter_Engine_MKL2017;
#else
engine = BatchNormParameter_Engine_CAFFE;
#endif
}
if (engine == BatchNormParameter_Engine_CAFFE) {
return shared_ptr<Layer<Dtype> >(new BatchNormLayer<Dtype>(param));
#if defined(MKL2017_SUPPORTED)
} else if (engine == BatchNormParameter_Engine_MKL2017) {
return shared_ptr<Layer<Dtype> >(new MKLBatchNormLayer<Dtype>(param));
#endif
} else {
LOG(FATAL) << "Layer " << param.name() << " has unknown engine.";
}
}
示例3: ep
shared_ptr<Layer<Dtype> > GetBatchNormLayer(const LayerParameter& param) {
BatchNormParameter_Engine engine = param.batch_norm_param().engine();
// New, more flexible way of providing engine
if (engine == BatchNormParameter_Engine_DEFAULT && param.engine() != "") {
EngineParser ep(param.engine());
if (ep.isEngine("CAFFE"))
engine = BatchNormParameter_Engine_CAFFE;
#if defined(MKL2017_SUPPORTED)
else if (ep.isEngine("MKL2017"))
engine = BatchNormParameter_Engine_MKL2017;
#endif
#if defined(MKLDNN_SUPPORTED)
else if (ep.isEngine("MKLDNN"))
engine = BatchNormParameter_Engine_MKLDNN;
#endif
}
if (engine == BatchNormParameter_Engine_DEFAULT) {
engine = BatchNormParameter_Engine_CAFFE;
}
if (engine == BatchNormParameter_Engine_CAFFE) {
return shared_ptr<Layer<Dtype> >(new BatchNormLayer<Dtype>(param));
#if defined(MKL2017_SUPPORTED)
} else if (engine == BatchNormParameter_Engine_MKL2017) {
return shared_ptr<Layer<Dtype> >(new MKLBatchNormLayer<Dtype>(param));
#endif
#ifdef MKLDNN_SUPPORTED
} else if (engine == BatchNormParameter_Engine_MKLDNN) {
return shared_ptr<Layer<Dtype> >(new MKLDNNBatchNormLayer<Dtype>(param));
#endif
} else {
LOG(FATAL) << "Layer " << param.name() << " has unknown engine.";
}
return shared_ptr<Layer<Dtype> >();
}