diff --git a/paddle/fluid/framework/feed_fetch_type.h b/paddle/fluid/framework/feed_fetch_type.h index 571667bff47eb454c0366398faa6d04d84448219..e51f22a2c3c1818ccf96ab2888bb2df38a8b9f3c 100644 --- a/paddle/fluid/framework/feed_fetch_type.h +++ b/paddle/fluid/framework/feed_fetch_type.h @@ -26,6 +26,11 @@ namespace framework { using FeedType = paddle::variant; +template <> +struct PhiVectorType { + const char *type_name = "PhiVectorFeedType"; +}; + using FeedList = paddle::framework::PhiVector; using FetchType = paddle::variant +struct PhiVectorType; + +template <> +struct PhiVectorType { + const char* type_name = "PhiVectorString"; +}; + template class PhiVector : public phi::ExtendedTensor, public phi::TypeInfoTraits> { @@ -129,9 +137,7 @@ class PhiVector : public phi::ExtendedTensor, public: /// \brief Returns the name of the class for type traits. /// \return The name of the class. - static const char* name() { - return (std::string("PhiVector_") + std::string(typeid(T).name())).c_str(); - } + static const char* name() { return PhiVectorType().type_name; } size_t size() const { return data_.size(); } diff --git a/paddle/fluid/operators/controlflow/feed_op.cc b/paddle/fluid/operators/controlflow/feed_op.cc index 09684b8d737bae2c2677e026f534581ec7ba881f..9d266b81d0babcef6f6cc152fbb29781296dbc0f 100644 --- a/paddle/fluid/operators/controlflow/feed_op.cc +++ b/paddle/fluid/operators/controlflow/feed_op.cc @@ -267,44 +267,6 @@ PD_REGISTER_GENERAL_KERNEL( ALL_LAYOUT, paddle::operators::FeedStringsKernel, ALL_DTYPE) {} -#elif defined(PADDLE_WITH_ASCEND_CL) -PD_REGISTER_GENERAL_KERNEL( - feed_dense_tensor, - npu, - ALL_LAYOUT, - paddle::operators::FeedDenseTensorKernel, - ALL_DTYPE) {} -PD_REGISTER_GENERAL_KERNEL( - feed_sparse_coo_tensor, - npu, - ALL_LAYOUT, - paddle::operators::FeedSparseCooTensorKernel, - ALL_DTYPE) {} -PD_REGISTER_GENERAL_KERNEL( - feed_strings, - npu, - ALL_LAYOUT, - paddle::operators::FeedStringsKernel, - ALL_DTYPE) {} -#elif defined(PADDLE_WITH_MLU) -PD_REGISTER_GENERAL_KERNEL( - feed_dense_tensor, - CustomMLU, - ALL_LAYOUT, - paddle::operators::FeedDenseTensorKernel, - ALL_DTYPE) {} -PD_REGISTER_GENERAL_KERNEL( - feed_sparse_coo_tensor, - CustomMLU, - ALL_LAYOUT, - paddle::operators::FeedSparseCooTensorKernel, - ALL_DTYPE) {} -PD_REGISTER_GENERAL_KERNEL( - feed_strings, - CustomMLU, - ALL_LAYOUT, - paddle::operators::FeedStringsKernel, - ALL_DTYPE) {} #endif #ifdef PADDLE_WITH_CUSTOM_DEVICE namespace paddle { diff --git a/paddle/phi/kernels/funcs/CMakeLists.txt b/paddle/phi/kernels/funcs/CMakeLists.txt index e4f779c807570ea107496e1fce235c30625a910c..da8f47c7bffd469f9632f4444b713b62dd35cede 100644 --- a/paddle/phi/kernels/funcs/CMakeLists.txt +++ b/paddle/phi/kernels/funcs/CMakeLists.txt @@ -27,7 +27,7 @@ math_library(sequence_scale) cc_library( phi_data_layout_transform SRCS data_layout_transform.cc - DEPS tensor) + DEPS tensor blas) if(WITH_GPU OR WITH_ROCM) if(MKL_FOUND AND WITH_ONEMKL)