From 0668650f2534fb6e4cc38bca58706e431b909259 Mon Sep 17 00:00:00 2001 From: Ghost Screaming Date: Mon, 21 Aug 2023 14:42:12 +0800 Subject: [PATCH] Add c_embedding forward compat op. (#56377) * Add c_embedding forward compat op. * Fix some bugs. * Polish code style. --- paddle/phi/ops/compat/c_embedding_sig.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/paddle/phi/ops/compat/c_embedding_sig.cc b/paddle/phi/ops/compat/c_embedding_sig.cc index bed568433ca..5287bd91d80 100644 --- a/paddle/phi/ops/compat/c_embedding_sig.cc +++ b/paddle/phi/ops/compat/c_embedding_sig.cc @@ -15,6 +15,9 @@ #include "paddle/phi/core/compat/op_utils.h" namespace phi { +KernelSignature CEmbeddingOpArgumentMapping(const ArgumentMappingContext& ctx) { + return KernelSignature("c_embedding", {"W", "Ids"}, {"start_index"}, {"Out"}); +} KernelSignature CEmbeddingGradOpArgumentMapping( const ArgumentMappingContext& ctx) { @@ -23,8 +26,9 @@ KernelSignature CEmbeddingGradOpArgumentMapping( {"start_index"}, {"W@GRAD"}); } - } // namespace phi +PD_REGISTER_ARG_MAPPING_FN(c_embedding, phi::CEmbeddingOpArgumentMapping); + PD_REGISTER_ARG_MAPPING_FN(c_embedding_grad, phi::CEmbeddingGradOpArgumentMapping); -- GitLab