From ddffa5f6a7f4b8ccc6be47a7bd5abed4f9e52524 Mon Sep 17 00:00:00 2001 From: chengduozh Date: Thu, 1 Nov 2018 15:58:05 +0800 Subject: [PATCH] fix merge lod_tensor bug test=release/1.1 --- paddle/fluid/framework/lod_tensor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/framework/lod_tensor.cc b/paddle/fluid/framework/lod_tensor.cc index 1e7da9a69c..669d08c70c 100644 --- a/paddle/fluid/framework/lod_tensor.cc +++ b/paddle/fluid/framework/lod_tensor.cc @@ -418,7 +418,7 @@ void LoDTensor::MergeLoDTensor( PADDLE_ENFORCE_EQ(new_lod.size(), lod.size()); for (size_t j = 0; j < lod.size(); ++j) { auto &sub_lod = new_lod[j]; - auto &offset = sub_lod.back(); + size_t offset = sub_lod.back(); for (size_t k = 1; k < lod[j].size(); ++k) { sub_lod.push_back(lod[j][k] + offset); } -- GitLab