From 5f1c07da85c1846135ac0601f24a8cdd18c5e4e5 Mon Sep 17 00:00:00 2001 From: Aurelius84 Date: Mon, 17 May 2021 11:19:10 +0800 Subject: [PATCH] BugFix with ParseInputDataType from LodTensorArray (#32918) * BugFix with ParseInputDataType from LodTensorArray * BugFix with ParseInputDataType from LodTensorArray --- paddle/fluid/framework/operator.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index c27f48f73c8..25d430df458 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -1555,10 +1555,10 @@ void OperatorWithKernel::ParseInputDataType( } else if (var->IsType()) { t = &(var->Get().value()); } else if (var->IsType()) { - auto t_arr = var->Get(); - for (size_t j = 0; j < t_arr.size(); j++) { - if (t_arr[j].IsInitialized()) { - t = &(t_arr[j]); + auto t_arr = &var->Get(); + for (size_t j = 0; j < t_arr->size(); j++) { + if (t_arr->at(j).IsInitialized()) { + t = &(t_arr->at(j)); } } } -- GitLab