diff --git a/paddle/fluid/operators/checkpoint_load_op.cc b/paddle/fluid/operators/checkpoint_load_op.cc index 241886e2be56694e97b1b8cb069498825da9ab8d..72cfccaaa22b7d354208a9b744c5ea1e32364653 100644 --- a/paddle/fluid/operators/checkpoint_load_op.cc +++ b/paddle/fluid/operators/checkpoint_load_op.cc @@ -86,11 +86,11 @@ class CheckpointLoadOp : public framework::OperatorBase { var_file.append(inp_var_names[i]); VLOG(3) << "ready to load var: " << inp_var_names[i]; - auto &tensor = var->Get(); + auto *tensor = var->GetMutable(); std::ifstream fin(var_file); PADDLE_ENFORCE(static_cast(fin), "Cannot open file %s for load op", var_file); - DeserializeFromStream(fin, tensor, dev_ctx); + framework::DeserializeFromStream(fin, tensor, dev_ctx); fin.close(); VLOG(3) << " load var: " << inp_var_names[i] << " finished";