diff --git a/paddle/fluid/operators/save_op.cc b/paddle/fluid/operators/save_op.cc index bc1f5a0d34f60e03e5b47d2b6aff06f9d3db527c..2450d64542a780d4233316f30a6cb3740187c953 100644 --- a/paddle/fluid/operators/save_op.cc +++ b/paddle/fluid/operators/save_op.cc @@ -101,7 +101,9 @@ PD_REGISTER_KERNEL(save, int16_t, int64_t, phi::dtype::float16, - phi::dtype::bfloat16) {} + phi::dtype::bfloat16) { + kernel->InputAt(0).SetBackend(phi::Backend::ALL_BACKEND); +} PD_REGISTER_KERNEL(save_sr, CPU, @@ -115,7 +117,9 @@ PD_REGISTER_KERNEL(save_sr, int16_t, int64_t, phi::dtype::float16, - phi::dtype::bfloat16) {} + phi::dtype::bfloat16) { + kernel->InputAt(0).SetBackend(phi::Backend::ALL_BACKEND); +} #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) PD_REGISTER_KERNEL(save, @@ -130,7 +134,9 @@ PD_REGISTER_KERNEL(save, int16_t, int64_t, phi::dtype::float16, - phi::dtype::bfloat16) {} + phi::dtype::bfloat16) { + kernel->InputAt(0).SetBackend(phi::Backend::ALL_BACKEND); +} PD_REGISTER_KERNEL(save_sr, GPU, @@ -144,5 +150,7 @@ PD_REGISTER_KERNEL(save_sr, int16_t, int64_t, phi::dtype::float16, - phi::dtype::bfloat16) {} + phi::dtype::bfloat16) { + kernel->InputAt(0).SetBackend(phi::Backend::ALL_BACKEND); +} #endif