From 7ca48f9ce321885821ad8913b8436125e0ff34d3 Mon Sep 17 00:00:00 2001 From: phlrain Date: Mon, 21 Mar 2022 04:11:50 +0000 Subject: [PATCH] fix paddle throw type --- paddle/phi/kernels/cpu/embedding_grad_kernel.cc | 6 ++++-- paddle/phi/kernels/cpu/embedding_kernel.cc | 3 ++- .../phi/kernels/cpu/sparse_weight_embedding_grad_kernel.cc | 6 ++++-- paddle/phi/kernels/cpu/sparse_weight_embedding_kernel.cc | 3 ++- paddle/phi/kernels/gpu/embedding_grad_kernel.cu | 6 ++++-- paddle/phi/kernels/gpu/embedding_kernel.cu | 3 ++- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/paddle/phi/kernels/cpu/embedding_grad_kernel.cc b/paddle/phi/kernels/cpu/embedding_grad_kernel.cc index 8402931ed89..21b3e6da8d9 100644 --- a/paddle/phi/kernels/cpu/embedding_grad_kernel.cc +++ b/paddle/phi/kernels/cpu/embedding_grad_kernel.cc @@ -115,7 +115,8 @@ void EmbeddingGradKernel(const Context& ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } @@ -195,7 +196,8 @@ void EmbeddingSparseGradKernel(const Context& ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } diff --git a/paddle/phi/kernels/cpu/embedding_kernel.cc b/paddle/phi/kernels/cpu/embedding_kernel.cc index 2973f426aa5..76cc3814b05 100644 --- a/paddle/phi/kernels/cpu/embedding_kernel.cc +++ b/paddle/phi/kernels/cpu/embedding_kernel.cc @@ -98,7 +98,8 @@ void EmbeddingKernel(const Context& ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } diff --git a/paddle/phi/kernels/cpu/sparse_weight_embedding_grad_kernel.cc b/paddle/phi/kernels/cpu/sparse_weight_embedding_grad_kernel.cc index 4846f209660..d78477073ad 100644 --- a/paddle/phi/kernels/cpu/sparse_weight_embedding_grad_kernel.cc +++ b/paddle/phi/kernels/cpu/sparse_weight_embedding_grad_kernel.cc @@ -180,7 +180,8 @@ void SparseWeightEmbeddingGradKernel(const Context& ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } @@ -199,7 +200,8 @@ void SparseWeightEmbeddingSparseGradKernel(const Context& ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } diff --git a/paddle/phi/kernels/cpu/sparse_weight_embedding_kernel.cc b/paddle/phi/kernels/cpu/sparse_weight_embedding_kernel.cc index fb29feee24a..c0f95d03888 100644 --- a/paddle/phi/kernels/cpu/sparse_weight_embedding_kernel.cc +++ b/paddle/phi/kernels/cpu/sparse_weight_embedding_kernel.cc @@ -102,7 +102,8 @@ void SparseWeightEmbeddingKernel(const Context& ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } diff --git a/paddle/phi/kernels/gpu/embedding_grad_kernel.cu b/paddle/phi/kernels/gpu/embedding_grad_kernel.cu index def7988ba51..a970348760c 100644 --- a/paddle/phi/kernels/gpu/embedding_grad_kernel.cu +++ b/paddle/phi/kernels/gpu/embedding_grad_kernel.cu @@ -131,7 +131,8 @@ void EmbeddingGradKernel(const Context& ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } @@ -233,7 +234,8 @@ void EmbeddingSparseGradKernel(const Context& ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } diff --git a/paddle/phi/kernels/gpu/embedding_kernel.cu b/paddle/phi/kernels/gpu/embedding_kernel.cu index 4d349c6ab5c..7f3a31ba544 100644 --- a/paddle/phi/kernels/gpu/embedding_kernel.cu +++ b/paddle/phi/kernels/gpu/embedding_kernel.cu @@ -110,7 +110,8 @@ void EmbeddingKernel(const Context &ctx, } else if (input.dtype() == phi::DataType::INT64) { functor.template apply(); } else { - PADDLE_THROW("emebdding input only support int32 and int64"); + PADDLE_THROW(phi::errors::Unimplemented( + "emebdding input only support int32 and int64")); } } -- GitLab