diff --git a/paddle/fluid/operators/coalesce_tensor_op.cc b/paddle/fluid/operators/coalesce_tensor_op.cc index c9cc01b8b17dc7eed345b118816b39eb9895002b..d2addb32bca005da8c347049dce31e65ba2f68f3 100644 --- a/paddle/fluid/operators/coalesce_tensor_op.cc +++ b/paddle/fluid/operators/coalesce_tensor_op.cc @@ -167,6 +167,12 @@ class CoalesceTensorOpKernel : public framework::OpKernel { auto out_tensors = context.MultiOutput("Output"); size_t offset = 0; if (context.Attr("copy_data")) { +#ifdef PADDLE_WITH_ASCEND_CL + framework::VisitDataType( + dtype, + FillConstantVisitor( + dev_ctx, fused_tensor, static_cast(0.0), dtype, context)); +#endif for (size_t i = 0; i < in_var_names.size(); ++i) { size_t len = static_cast(in_tensors[i]->numel()); auto sub_tensor = fused_tensor->Slice(