From 8ecaa8a5d8d7fb9a68e9b7a4677efb7fba3a7a34 Mon Sep 17 00:00:00 2001 From: Aurelius84 Date: Thu, 20 May 2021 19:45:18 +0800 Subject: [PATCH] BugFix with ParseInputDataType from LodTensorArray (#32918) (#32984) * 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 955c917b2c..1e26dab629 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -1549,10 +1549,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