Remove warning in batch_norm_op (#19260)

padding_in_crf
qingqing01 6 years ago committed by GitHub
parent d08d5ab519
commit 5fc8de449a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -245,8 +245,8 @@ class BatchNormKernel<platform::CPUDeviceContext, T>
variance_out->mutable_data<T>(ctx.GetPlace()), C); variance_out->mutable_data<T>(ctx.GetPlace()), C);
if ((N * sample_size) == 1) { if ((N * sample_size) == 1) {
LOG(WARNING) << "Only 1 element in normalization dimension, " // Only 1 element in normalization dimension,
<< "we skip the batch norm calculation, let y = x."; // we skip the batch norm calculation, let y = x.
framework::TensorCopy(*x, ctx.GetPlace(), y); framework::TensorCopy(*x, ctx.GetPlace(), y);
return; return;
} }

@ -152,8 +152,8 @@ class BatchNormKernel<platform::CUDADeviceContext, T>
functor(dev_ctx, saved_variance, static_cast<BatchNormParamType<T>>(0)); functor(dev_ctx, saved_variance, static_cast<BatchNormParamType<T>>(0));
if ((N * H * W * D) == 1) { if ((N * H * W * D) == 1) {
LOG(WARNING) << "Only 1 element in normalization dimension, " // Only 1 element in normalization dimension,
<< "we skip the batch norm calculation, let y = x."; // skip the batch norm calculation, let y = x.
framework::TensorCopy(*x, ctx.GetPlace(), y); framework::TensorCopy(*x, ctx.GetPlace(), y);
} else { } else {
double this_factor = 1. - momentum; double this_factor = 1. - momentum;

Loading…
Cancel
Save