Skip to content

Commit 23dbe41

Browse files
committed
fix bugs
1 parent 9737525 commit 23dbe41

File tree

3 files changed

+7
-40
lines changed

3 files changed

+7
-40
lines changed

paddle/fluid/framework/string_array.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ class PhiVector : public phi::ExtendedTensor,
130130
/// \brief Returns the name of the class for type traits.
131131
/// \return The name of the class.
132132
static const char* name() {
133-
return (std::string("PhiVector_") + std::string(typeid(T).name())).c_str();
133+
name_ = std::string("PhiVector_") + std::string(typeid(T).name());
134+
return name_.c_str();
134135
}
135136

136137
size_t size() const { return data_.size(); }
@@ -161,8 +162,12 @@ class PhiVector : public phi::ExtendedTensor,
161162

162163
private:
163164
std::vector<T> data_;
165+
static std::string name_;
164166
};
165167

168+
template <typename T>
169+
std::string PhiVector<T>::name_ = ""; // NOLINT
170+
166171
using String = std::string;
167172
using Strings = PhiVector<std::string>;
168173

paddle/fluid/operators/controlflow/feed_op.cc

-38
Original file line numberDiff line numberDiff line change
@@ -267,44 +267,6 @@ PD_REGISTER_GENERAL_KERNEL(
267267
ALL_LAYOUT,
268268
paddle::operators::FeedStringsKernel<phi::XPUContext>,
269269
ALL_DTYPE) {}
270-
#elif defined(PADDLE_WITH_ASCEND_CL)
271-
PD_REGISTER_GENERAL_KERNEL(
272-
feed_dense_tensor,
273-
npu,
274-
ALL_LAYOUT,
275-
paddle::operators::FeedDenseTensorKernel<phi::CustomContext>,
276-
ALL_DTYPE) {}
277-
PD_REGISTER_GENERAL_KERNEL(
278-
feed_sparse_coo_tensor,
279-
npu,
280-
ALL_LAYOUT,
281-
paddle::operators::FeedSparseCooTensorKernel<phi::CustomContext>,
282-
ALL_DTYPE) {}
283-
PD_REGISTER_GENERAL_KERNEL(
284-
feed_strings,
285-
npu,
286-
ALL_LAYOUT,
287-
paddle::operators::FeedStringsKernel<phi::CustomContext>,
288-
ALL_DTYPE) {}
289-
#elif defined(PADDLE_WITH_MLU)
290-
PD_REGISTER_GENERAL_KERNEL(
291-
feed_dense_tensor,
292-
CustomMLU,
293-
ALL_LAYOUT,
294-
paddle::operators::FeedDenseTensorKernel<phi::CustomContext>,
295-
ALL_DTYPE) {}
296-
PD_REGISTER_GENERAL_KERNEL(
297-
feed_sparse_coo_tensor,
298-
CustomMLU,
299-
ALL_LAYOUT,
300-
paddle::operators::FeedSparseCooTensorKernel<phi::CustomContext>,
301-
ALL_DTYPE) {}
302-
PD_REGISTER_GENERAL_KERNEL(
303-
feed_strings,
304-
CustomMLU,
305-
ALL_LAYOUT,
306-
paddle::operators::FeedStringsKernel<phi::CustomContext>,
307-
ALL_DTYPE) {}
308270
#endif
309271
#ifdef PADDLE_WITH_CUSTOM_DEVICE
310272
namespace paddle {

paddle/phi/kernels/funcs/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ math_library(sequence_scale)
2727
cc_library(
2828
phi_data_layout_transform
2929
SRCS data_layout_transform.cc
30-
DEPS tensor)
30+
DEPS tensor blas)
3131

3232
if(WITH_GPU OR WITH_ROCM)
3333
if(MKL_FOUND AND WITH_ONEMKL)

0 commit comments

Comments
 (0)