From 1e1c72751827281ec5b83b30ca17e11a8f64d227 Mon Sep 17 00:00:00 2001 From: will-jl944 Date: Wed, 19 Oct 2022 11:07:30 +0800 Subject: [PATCH] slice op supports uint8_t (#47067) --- paddle/fluid/operators/slice_op.cc | 4 ++++ paddle/phi/kernels/cpu/slice_grad_kernel.cc | 1 + paddle/phi/kernels/cpu/slice_kernel.cc | 1 + paddle/phi/kernels/funcs/eigen/pad.cc | 1 + paddle/phi/kernels/funcs/eigen/pad.cu | 1 + paddle/phi/kernels/funcs/eigen/slice.cu | 1 + paddle/phi/kernels/gpu/slice_grad_kernel.cu.cc | 1 + paddle/phi/kernels/gpu/slice_kernel.cu.cc | 1 + 8 files changed, 11 insertions(+) mode change 100755 => 100644 paddle/fluid/operators/slice_op.cc diff --git a/paddle/fluid/operators/slice_op.cc b/paddle/fluid/operators/slice_op.cc old mode 100755 new mode 100644 index 8d23ce8d11..2b3be3d78b --- a/paddle/fluid/operators/slice_op.cc +++ b/paddle/fluid/operators/slice_op.cc @@ -460,6 +460,7 @@ REGISTER_OPERATOR(slice_grad, REGISTER_OP_CPU_KERNEL( slice, ops::SliceKernel, + ops::SliceKernel, ops::SliceKernel, ops::SliceKernel, ops::SliceKernel, @@ -471,6 +472,7 @@ REGISTER_OP_CPU_KERNEL( REGISTER_OP_CPU_KERNEL( slice_grad, ops::SliceGradKernel, + ops::SliceGradKernel, ops::SliceGradKernel, ops::SliceGradKernel, ops::SliceGradKernel, @@ -482,6 +484,7 @@ REGISTER_OP_CPU_KERNEL( REGISTER_OP_CUDA_KERNEL( slice, ops::SliceKernel, + ops::SliceKernel, ops::SliceKernel, ops::SliceKernel, ops::SliceKernel, @@ -494,6 +497,7 @@ REGISTER_OP_CUDA_KERNEL( REGISTER_OP_CUDA_KERNEL( slice_grad, ops::SliceGradKernel, + ops::SliceGradKernel, ops::SliceGradKernel, ops::SliceGradKernel, ops::SliceGradKernel, diff --git a/paddle/phi/kernels/cpu/slice_grad_kernel.cc b/paddle/phi/kernels/cpu/slice_grad_kernel.cc index 7e3efd2175..f22e3634f1 100644 --- a/paddle/phi/kernels/cpu/slice_grad_kernel.cc +++ b/paddle/phi/kernels/cpu/slice_grad_kernel.cc @@ -23,6 +23,7 @@ PD_REGISTER_KERNEL(slice_grad, ALL_LAYOUT, phi::SliceGradRawKernel, bool, + uint8_t, int, int64_t, float, diff --git a/paddle/phi/kernels/cpu/slice_kernel.cc b/paddle/phi/kernels/cpu/slice_kernel.cc index 0f2fe98a85..ff9a5c1593 100644 --- a/paddle/phi/kernels/cpu/slice_kernel.cc +++ b/paddle/phi/kernels/cpu/slice_kernel.cc @@ -23,6 +23,7 @@ PD_REGISTER_KERNEL(slice, ALL_LAYOUT, phi::SliceRawKernel, bool, + uint8_t, int, int64_t, float, diff --git a/paddle/phi/kernels/funcs/eigen/pad.cc b/paddle/phi/kernels/funcs/eigen/pad.cc index c457199b0a..8041fc4ae1 100644 --- a/paddle/phi/kernels/funcs/eigen/pad.cc +++ b/paddle/phi/kernels/funcs/eigen/pad.cc @@ -59,6 +59,7 @@ struct EigenPad { template struct FUNCTOR; INSTANTIATION(EigenPad, bool); +INSTANTIATION(EigenPad, uint8_t); INSTANTIATION(EigenPad, int); INSTANTIATION(EigenPad, int64_t); INSTANTIATION(EigenPad, float); diff --git a/paddle/phi/kernels/funcs/eigen/pad.cu b/paddle/phi/kernels/funcs/eigen/pad.cu index 7d8c2580d9..c4a3dd9ecc 100644 --- a/paddle/phi/kernels/funcs/eigen/pad.cu +++ b/paddle/phi/kernels/funcs/eigen/pad.cu @@ -59,6 +59,7 @@ struct EigenPad { template struct FUNCTOR; \ template struct FUNCTOR INSTANTIATION(EigenPad, bool); +INSTANTIATION(EigenPad, uint8_t); INSTANTIATION(EigenPad, int); INSTANTIATION(EigenPad, int64_t); INSTANTIATION(EigenPad, float); diff --git a/paddle/phi/kernels/funcs/eigen/slice.cu b/paddle/phi/kernels/funcs/eigen/slice.cu index 36f705f168..ade58d0698 100644 --- a/paddle/phi/kernels/funcs/eigen/slice.cu +++ b/paddle/phi/kernels/funcs/eigen/slice.cu @@ -59,6 +59,7 @@ struct EigenSlice { template struct FUNCTOR; \ template struct FUNCTOR INSTANTIATION(EigenSlice, bool); +INSTANTIATION(EigenSlice, uint8_t); INSTANTIATION(EigenSlice, int); INSTANTIATION(EigenSlice, int64_t); INSTANTIATION(EigenSlice, float); diff --git a/paddle/phi/kernels/gpu/slice_grad_kernel.cu.cc b/paddle/phi/kernels/gpu/slice_grad_kernel.cu.cc index a6db80abae..ec575ab952 100644 --- a/paddle/phi/kernels/gpu/slice_grad_kernel.cu.cc +++ b/paddle/phi/kernels/gpu/slice_grad_kernel.cu.cc @@ -23,6 +23,7 @@ PD_REGISTER_KERNEL(slice_grad, ALL_LAYOUT, phi::SliceGradRawKernel, bool, + uint8_t, int, int64_t, float, diff --git a/paddle/phi/kernels/gpu/slice_kernel.cu.cc b/paddle/phi/kernels/gpu/slice_kernel.cu.cc index 8743163b22..5232ce3581 100644 --- a/paddle/phi/kernels/gpu/slice_kernel.cu.cc +++ b/paddle/phi/kernels/gpu/slice_kernel.cu.cc @@ -23,6 +23,7 @@ PD_REGISTER_KERNEL(slice, ALL_LAYOUT, phi::SliceRawKernel, bool, + uint8_t, int, int64_t, float, -- GitLab