提交 03f8fc19 编写于 作者: Z zhupengyang 提交者: GitHub

register arm kernel cast, fill_constant, fill_constant_batch_size_like to kAny (#3076)

上级 8fa18795
...@@ -73,7 +73,7 @@ void CastCompute::Run() { ...@@ -73,7 +73,7 @@ void CastCompute::Run() {
} // namespace paddle } // namespace paddle
REGISTER_LITE_KERNEL( 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))}) .BindInput("X", {LiteType::GetTensorTy(TARGET(kARM), PRECISION(kAny))})
.BindOutput("Out", {LiteType::GetTensorTy(TARGET(kARM), PRECISION(kAny))}) .BindOutput("Out", {LiteType::GetTensorTy(TARGET(kARM), PRECISION(kAny))})
.Finalize(); .Finalize();
...@@ -23,7 +23,7 @@ namespace lite { ...@@ -23,7 +23,7 @@ namespace lite {
namespace kernels { namespace kernels {
namespace arm { namespace arm {
class CastCompute : public KernelLite<TARGET(kARM), PRECISION(kFloat)> { class CastCompute : public KernelLite<TARGET(kARM), PRECISION(kAny)> {
public: public:
using param_t = operators::CastParam; using param_t = operators::CastParam;
......
...@@ -52,7 +52,7 @@ void FillConstantBatchSizeLikeCompute::Run() { ...@@ -52,7 +52,7 @@ void FillConstantBatchSizeLikeCompute::Run() {
REGISTER_LITE_KERNEL( REGISTER_LITE_KERNEL(
fill_constant_batch_size_like, fill_constant_batch_size_like,
kARM, kARM,
kFloat, kAny,
kNCHW, kNCHW,
paddle::lite::kernels::arm::FillConstantBatchSizeLikeCompute, paddle::lite::kernels::arm::FillConstantBatchSizeLikeCompute,
def) def)
......
...@@ -22,7 +22,7 @@ namespace kernels { ...@@ -22,7 +22,7 @@ namespace kernels {
namespace arm { namespace arm {
class FillConstantBatchSizeLikeCompute class FillConstantBatchSizeLikeCompute
: public KernelLite<TARGET(kARM), PRECISION(kFloat)> { : public KernelLite<TARGET(kARM), PRECISION(kAny)> {
public: public:
using param_t = operators::FillConstantBatchSizeLikeParam; using param_t = operators::FillConstantBatchSizeLikeParam;
......
...@@ -52,7 +52,7 @@ void FillConstantCompute::Run() { ...@@ -52,7 +52,7 @@ void FillConstantCompute::Run() {
// float // float
REGISTER_LITE_KERNEL(fill_constant, REGISTER_LITE_KERNEL(fill_constant,
kARM, kARM,
kFloat, kAny,
kNCHW, kNCHW,
paddle::lite::kernels::arm::FillConstantCompute, paddle::lite::kernels::arm::FillConstantCompute,
def) def)
......
...@@ -21,7 +21,7 @@ namespace lite { ...@@ -21,7 +21,7 @@ namespace lite {
namespace kernels { namespace kernels {
namespace arm { namespace arm {
class FillConstantCompute : public KernelLite<TARGET(kARM), PRECISION(kFloat)> { class FillConstantCompute : public KernelLite<TARGET(kARM), PRECISION(kAny)> {
public: public:
using param_t = operators::FillConstantParam; using param_t = operators::FillConstantParam;
......
...@@ -163,7 +163,7 @@ TEST(Cast, precision) { ...@@ -163,7 +163,7 @@ TEST(Cast, precision) {
Place place; Place place;
float abs_error = 2e-5; float abs_error = 2e-5;
#if defined(LITE_WITH_ARM) #if defined(LITE_WITH_ARM)
place = TARGET(kARM); place = {TARGET(kARM), PRECISION(kAny)};
#elif defined(LITE_WITH_XPU) #elif defined(LITE_WITH_XPU)
place = TARGET(kXPU); place = TARGET(kXPU);
#else #else
......
...@@ -138,7 +138,7 @@ TEST(fill_constant_batch_size_like, precision) { ...@@ -138,7 +138,7 @@ TEST(fill_constant_batch_size_like, precision) {
place = TARGET(kNPU); place = TARGET(kNPU);
abs_error = 1e-2; // use fp16 in npu abs_error = 1e-2; // use fp16 in npu
#elif defined(LITE_WITH_ARM) #elif defined(LITE_WITH_ARM)
place = TARGET(kARM); place = {TARGET(kARM), PRECISION(kAny)};
#else #else
return; return;
#endif #endif
......
...@@ -175,7 +175,7 @@ TEST(fill_constant, precision) { ...@@ -175,7 +175,7 @@ TEST(fill_constant, precision) {
place = TARGET(kNPU); place = TARGET(kNPU);
abs_error = 1e-2; // use fp16 in npu abs_error = 1e-2; // use fp16 in npu
#elif defined(LITE_WITH_ARM) #elif defined(LITE_WITH_ARM)
place = TARGET(kARM); place = {TARGET(kARM), PRECISION(kAny)};
#else #else
return; return;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册