From c055b50c3da8733d41282071ed2aa6ffd98176e4 Mon Sep 17 00:00:00 2001 From: zyfncg Date: Tue, 12 Apr 2022 09:00:33 +0800 Subject: [PATCH] fix data transform problem for cudnn backend (#41622) --- paddle/phi/api/lib/data_transform.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/phi/api/lib/data_transform.cc b/paddle/phi/api/lib/data_transform.cc index 90d47977cdf..82d2e741e9d 100644 --- a/paddle/phi/api/lib/data_transform.cc +++ b/paddle/phi/api/lib/data_transform.cc @@ -40,7 +40,8 @@ inline bool NeedTransformPlace(const paddle::platform::Place& input, bool ret = input.GetType() == AllocationType::GPUPINNED || (transform_flag.need_trans_backend() && target != Backend::ALL_BACKEND && - phi::TransToPhiBackend(input) != target); + phi::TransToPhiBackend(input) != + (target != Backend::GPUDNN ? target : Backend::GPU)); return ret; } -- GitLab