diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index 9bd70d46046fa5627533f546639f6b896e91f90a..42e70d9cb0d9b4a8a99c88f23eeb75c9fac937e6 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -648,7 +648,7 @@ class RuntimeInferShapeContext : public InferShapeContext { Variable* out_var = out_it->second.at(j); PADDLE_ENFORCE(out_var->IsType(), "The %d-th output of Output(%s) must be LoDTensor.", j, out); - auto in_tensor = in_var->Get(); + auto& in_tensor = in_var->Get(); auto* out_tensor = out_var->GetMutable(); out_tensor->set_lod(in_tensor.lod());