From 5efe8c728706056f847a7449d712a460131794b1 Mon Sep 17 00:00:00 2001 From: Zhaolong Xing Date: Thu, 6 Jun 2019 14:23:38 +0800 Subject: [PATCH] fix bug: the lod_tensor_to_array op will aplly a new var but not release when dong inference (#17856) test=develop --- paddle/fluid/operators/lod_tensor_to_array_op.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/paddle/fluid/operators/lod_tensor_to_array_op.cc b/paddle/fluid/operators/lod_tensor_to_array_op.cc index 61e342737..962822f33 100644 --- a/paddle/fluid/operators/lod_tensor_to_array_op.cc +++ b/paddle/fluid/operators/lod_tensor_to_array_op.cc @@ -131,9 +131,7 @@ class LoDTensorToArrayOp : public framework::OperatorBase { } } - auto &outputs = *const_cast(scope) - .Var() - ->GetMutable>(); + std::map outputs; for (size_t i = 0; i < max_seq_len; ++i) { auto &ranges = copy_ranges[i]; -- GitLab