From b8e6fefcbe90367a77b441527fa6673bba160a65 Mon Sep 17 00:00:00 2001 From: hong19860320 <9973393+hong19860320@users.noreply.github.com> Date: Fri, 14 Jun 2019 15:22:11 +0000 Subject: [PATCH] enable batch_norm op in cxx_api_bin, fix the bug of batch_norm op test=develop --- paddle/fluid/lite/api/cxx_api_bin.cc | 2 +- paddle/fluid/lite/operators/batch_norm_op.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/lite/api/cxx_api_bin.cc b/paddle/fluid/lite/api/cxx_api_bin.cc index f17f7a7d5..b315030ed 100644 --- a/paddle/fluid/lite/api/cxx_api_bin.cc +++ b/paddle/fluid/lite/api/cxx_api_bin.cc @@ -69,7 +69,7 @@ USE_LITE_OP(fetch); USE_LITE_OP(io_copy); USE_LITE_OP(conv2d); -// USE_LITE_OP(batch_norm); +USE_LITE_OP(batch_norm); USE_LITE_OP(relu); USE_LITE_OP(depthwise_conv2d); USE_LITE_OP(pool2d); diff --git a/paddle/fluid/lite/operators/batch_norm_op.cc b/paddle/fluid/lite/operators/batch_norm_op.cc index e974d0134..b6ef87732 100644 --- a/paddle/fluid/lite/operators/batch_norm_op.cc +++ b/paddle/fluid/lite/operators/batch_norm_op.cc @@ -82,7 +82,7 @@ bool BatchNormOp::AttachImpl(const cpp::OpDesc &op_desc, lite::Scope *scope) { param_.variance = scope->FindVar(op_desc.Input("Variance").front())->GetMutable(); param_.y = scope->FindVar(op_desc.Output("Y").front())->GetMutable(); - param_.is_test = op_desc.GetAttr("is_test"); + param_.is_test = op_desc.GetAttr("is_test"); param_.use_global_stats = op_desc.GetAttr("use_global_stats"); if (!param_.is_test) { param_.mean_out = -- GitLab