diff --git a/lite/kernels/arm/norm_compute.cc b/lite/kernels/arm/norm_compute.cc index 3cc1645fc6823c4c3276cd1f22f4be8a584d2073..fb8b4bbe0773b808a0f6942d1120ebc7d4e844d2 100644 --- a/lite/kernels/arm/norm_compute.cc +++ b/lite/kernels/arm/norm_compute.cc @@ -47,4 +47,5 @@ REGISTER_LITE_KERNEL( norm, kARM, kFloat, kNCHW, paddle::lite::kernels::arm::NormCompute, def) .BindInput("X", {LiteType::GetTensorTy(TARGET(kARM))}) .BindOutput("Out", {LiteType::GetTensorTy(TARGET(kARM))}) + .BindOutput("Norm", {LiteType::GetTensorTy(TARGET(kARM))}) .Finalize(); diff --git a/lite/operators/op_params.h b/lite/operators/op_params.h index f7e0bcd4e498741ab911c5daf4358a72b646f009..394a83f4f4d60a39b3be0b6bfe3c13135ec3e22c 100644 --- a/lite/operators/op_params.h +++ b/lite/operators/op_params.h @@ -612,6 +612,7 @@ struct SequenceSoftmaxParam { struct NormParam { const lite::Tensor* X{}; lite::Tensor* Out{}; + lite::Tensor* Norm{}; int axis{1}; float epsilon{1e-10}; }; diff --git a/lite/tests/kernels/norm_compute_test.cc b/lite/tests/kernels/norm_compute_test.cc index 830bac062784a8c16752f4e43a23ed8157cc6c0f..6aee1758c19cd793de709921c4733b8892e5f3d9 100644 --- a/lite/tests/kernels/norm_compute_test.cc +++ b/lite/tests/kernels/norm_compute_test.cc @@ -46,7 +46,7 @@ class NormComputeTester : public arena::TestCase { auto* x = scope->FindTensor(input_); const auto* x_data = x->data(); - int axis = axis_ < 0 ? axis + dims_.size() : axis_; + int axis = axis_ < 0 ? axis_ + dims_.size() : axis_; int pre_n = dims_.count(0, axis); int n = dims_[axis]; int post_n = dims_.count(axis + 1, dims_.size());