From 03f8fc1974438e52ed7ae84c87808e6e4bb8390b Mon Sep 17 00:00:00 2001 From: zhupengyang <1165938320@qq.com> Date: Thu, 5 Mar 2020 09:55:26 +0800 Subject: [PATCH] register arm kernel cast, fill_constant, fill_constant_batch_size_like to kAny (#3076) --- lite/kernels/arm/cast_compute.cc | 2 +- lite/kernels/arm/cast_compute.h | 2 +- lite/kernels/arm/fill_constant_batch_size_like_compute.cc | 2 +- lite/kernels/arm/fill_constant_batch_size_like_compute.h | 2 +- lite/kernels/arm/fill_constant_compute.cc | 2 +- lite/kernels/arm/fill_constant_compute.h | 2 +- lite/tests/kernels/cast_compute_test.cc | 2 +- .../tests/kernels/fill_constant_batch_size_like_compute_test.cc | 2 +- lite/tests/kernels/fill_constant_compute_test.cc | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lite/kernels/arm/cast_compute.cc b/lite/kernels/arm/cast_compute.cc index 266ae1fc91..3b3ef07e10 100644 --- a/lite/kernels/arm/cast_compute.cc +++ b/lite/kernels/arm/cast_compute.cc @@ -73,7 +73,7 @@ void CastCompute::Run() { } // namespace paddle REGISTER_LITE_KERNEL( - cast, kARM, kFloat, kNCHW, paddle::lite::kernels::arm::CastCompute, def) + cast, kARM, kAny, kNCHW, paddle::lite::kernels::arm::CastCompute, def) .BindInput("X", {LiteType::GetTensorTy(TARGET(kARM), PRECISION(kAny))}) .BindOutput("Out", {LiteType::GetTensorTy(TARGET(kARM), PRECISION(kAny))}) .Finalize(); diff --git a/lite/kernels/arm/cast_compute.h b/lite/kernels/arm/cast_compute.h index d342a405ad..1f8da056a8 100644 --- a/lite/kernels/arm/cast_compute.h +++ b/lite/kernels/arm/cast_compute.h @@ -23,7 +23,7 @@ namespace lite { namespace kernels { namespace arm { -class CastCompute : public KernelLite { +class CastCompute : public KernelLite { public: using param_t = operators::CastParam; diff --git a/lite/kernels/arm/fill_constant_batch_size_like_compute.cc b/lite/kernels/arm/fill_constant_batch_size_like_compute.cc index c7944f007e..7bb096e022 100644 --- a/lite/kernels/arm/fill_constant_batch_size_like_compute.cc +++ b/lite/kernels/arm/fill_constant_batch_size_like_compute.cc @@ -52,7 +52,7 @@ void FillConstantBatchSizeLikeCompute::Run() { REGISTER_LITE_KERNEL( fill_constant_batch_size_like, kARM, - kFloat, + kAny, kNCHW, paddle::lite::kernels::arm::FillConstantBatchSizeLikeCompute, def) diff --git a/lite/kernels/arm/fill_constant_batch_size_like_compute.h b/lite/kernels/arm/fill_constant_batch_size_like_compute.h index 2107a943f0..23aa64bb64 100644 --- a/lite/kernels/arm/fill_constant_batch_size_like_compute.h +++ b/lite/kernels/arm/fill_constant_batch_size_like_compute.h @@ -22,7 +22,7 @@ namespace kernels { namespace arm { class FillConstantBatchSizeLikeCompute - : public KernelLite { + : public KernelLite { public: using param_t = operators::FillConstantBatchSizeLikeParam; diff --git a/lite/kernels/arm/fill_constant_compute.cc b/lite/kernels/arm/fill_constant_compute.cc index a17aa33e03..50e4f04102 100644 --- a/lite/kernels/arm/fill_constant_compute.cc +++ b/lite/kernels/arm/fill_constant_compute.cc @@ -52,7 +52,7 @@ void FillConstantCompute::Run() { // float REGISTER_LITE_KERNEL(fill_constant, kARM, - kFloat, + kAny, kNCHW, paddle::lite::kernels::arm::FillConstantCompute, def) diff --git a/lite/kernels/arm/fill_constant_compute.h b/lite/kernels/arm/fill_constant_compute.h index 5d5f7078a0..7717c4c262 100644 --- a/lite/kernels/arm/fill_constant_compute.h +++ b/lite/kernels/arm/fill_constant_compute.h @@ -21,7 +21,7 @@ namespace lite { namespace kernels { namespace arm { -class FillConstantCompute : public KernelLite { +class FillConstantCompute : public KernelLite { public: using param_t = operators::FillConstantParam; diff --git a/lite/tests/kernels/cast_compute_test.cc b/lite/tests/kernels/cast_compute_test.cc index a7316a6162..e3b27ce627 100644 --- a/lite/tests/kernels/cast_compute_test.cc +++ b/lite/tests/kernels/cast_compute_test.cc @@ -163,7 +163,7 @@ TEST(Cast, precision) { Place place; float abs_error = 2e-5; #if defined(LITE_WITH_ARM) - place = TARGET(kARM); + place = {TARGET(kARM), PRECISION(kAny)}; #elif defined(LITE_WITH_XPU) place = TARGET(kXPU); #else diff --git a/lite/tests/kernels/fill_constant_batch_size_like_compute_test.cc b/lite/tests/kernels/fill_constant_batch_size_like_compute_test.cc index 03cc99da82..e225d81ad0 100644 --- a/lite/tests/kernels/fill_constant_batch_size_like_compute_test.cc +++ b/lite/tests/kernels/fill_constant_batch_size_like_compute_test.cc @@ -138,7 +138,7 @@ TEST(fill_constant_batch_size_like, precision) { place = TARGET(kNPU); abs_error = 1e-2; // use fp16 in npu #elif defined(LITE_WITH_ARM) - place = TARGET(kARM); + place = {TARGET(kARM), PRECISION(kAny)}; #else return; #endif diff --git a/lite/tests/kernels/fill_constant_compute_test.cc b/lite/tests/kernels/fill_constant_compute_test.cc index c9ae1ebaa5..ef5a4fa778 100644 --- a/lite/tests/kernels/fill_constant_compute_test.cc +++ b/lite/tests/kernels/fill_constant_compute_test.cc @@ -175,7 +175,7 @@ TEST(fill_constant, precision) { place = TARGET(kNPU); abs_error = 1e-2; // use fp16 in npu #elif defined(LITE_WITH_ARM) - place = TARGET(kARM); + place = {TARGET(kARM), PRECISION(kAny)}; #else return; #endif -- GitLab