From 4b6f8099060db1df546c31796ca62d0621bae81f Mon Sep 17 00:00:00 2001 From: Zhang Zheng <32410583+ZzSean@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:21:44 +0800 Subject: [PATCH] Support int16_t in fill_constant_op (#35619) --- paddle/fluid/operators/fill_constant_op.cc | 4 ++-- paddle/fluid/operators/fill_constant_op.cu.cc | 4 ++-- paddle/fluid/operators/math/math_function.cc | 2 ++ paddle/fluid/operators/math/math_function.cu | 1 + python/paddle/fluid/layers/tensor.py | 14 +++++++------- .../fluid/tests/unittests/test_fill_constant_op.py | 9 +-------- .../paddle/fluid/tests/unittests/test_full_op.py | 2 +- 7 files changed, 16 insertions(+), 20 deletions(-) diff --git a/paddle/fluid/operators/fill_constant_op.cc b/paddle/fluid/operators/fill_constant_op.cc index 0dcbb6e727d..44dcc343a4b 100644 --- a/paddle/fluid/operators/fill_constant_op.cc +++ b/paddle/fluid/operators/fill_constant_op.cc @@ -149,8 +149,8 @@ REGISTER_OPERATOR( REGISTER_OP_CPU_KERNEL( fill_constant, ops::FillConstantKernel, ops::FillConstantKernel, ops::FillConstantKernel, - ops::FillConstantKernel, ops::FillConstantKernel, - ops::FillConstantKernel, + ops::FillConstantKernel, ops::FillConstantKernel, + ops::FillConstantKernel, ops::FillConstantKernel, ops::FillConstantKernel, ops::FillConstantKernel, ops::FillConstantKernel>, diff --git a/paddle/fluid/operators/fill_constant_op.cu.cc b/paddle/fluid/operators/fill_constant_op.cu.cc index a862cda1388..defd98f9d49 100644 --- a/paddle/fluid/operators/fill_constant_op.cu.cc +++ b/paddle/fluid/operators/fill_constant_op.cu.cc @@ -18,8 +18,8 @@ namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( fill_constant, ops::FillConstantKernel, ops::FillConstantKernel, ops::FillConstantKernel, - ops::FillConstantKernel, ops::FillConstantKernel, - ops::FillConstantKernel, + ops::FillConstantKernel, ops::FillConstantKernel, + ops::FillConstantKernel, ops::FillConstantKernel, ops::FillConstantKernel, ops::FillConstantKernel>, ops::FillConstantKernel>); diff --git a/paddle/fluid/operators/math/math_function.cc b/paddle/fluid/operators/math/math_function.cc index 1266ee7462d..9bd83391962 100644 --- a/paddle/fluid/operators/math/math_function.cc +++ b/paddle/fluid/operators/math/math_function.cc @@ -41,6 +41,7 @@ template struct SetConstant; template struct SetConstant; template struct SetConstant; template struct SetConstant; +template struct SetConstant; template struct SetConstant; template struct SetConstant; template struct SetConstant; @@ -56,6 +57,7 @@ template struct SetConstant; template struct SetConstant; template struct SetConstant; template struct SetConstant; +template struct SetConstant; template struct SetConstant; template struct SetConstant; template struct SetConstant; diff --git a/paddle/fluid/operators/math/math_function.cu b/paddle/fluid/operators/math/math_function.cu index 248f6212999..46dd58562ae 100644 --- a/paddle/fluid/operators/math/math_function.cu +++ b/paddle/fluid/operators/math/math_function.cu @@ -35,6 +35,7 @@ template struct SetConstant; template struct SetConstant; template struct SetConstant; template struct SetConstant; +template struct SetConstant; template struct SetConstant; template struct SetConstant; template struct SetConstant