From 469d5ab47a8ff08cba822f5c796bc93ab44b83e9 Mon Sep 17 00:00:00 2001 From: zyfncg Date: Wed, 13 Jul 2022 10:26:38 +0800 Subject: [PATCH] fix bug of data transform on xpu (#44262) --- paddle/fluid/framework/operator.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index 0fca87df34f..83521be98fc 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -2103,7 +2103,9 @@ Scope* OperatorWithKernel::PrepareData( auto tensor_backend = phi::TransToPhiBackend(tensor_in->place()); if ((in_def->backend != tensor_backend && (in_def->backend != phi::Backend::GPUDNN || - tensor_backend != phi::Backend::GPU)) || + tensor_backend != phi::Backend::GPU) && + (in_def->backend != phi::Backend::KPS || + tensor_backend != phi::Backend::XPU)) || tensor_in->place().GetType() == AllocationType::GPUPINNED) { new_expected_kernel_key = std::make_unique( expected_kernel_key.data_type_, -- GitLab