From 2d98a418d7822358e873ee64ae905b02d52668d6 Mon Sep 17 00:00:00 2001 From: Yancey Date: Fri, 4 May 2018 17:46:06 +0800 Subject: [PATCH] fix remove op (#10410) * fix remove op * update --- paddle/fluid/framework/block_desc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/framework/block_desc.cc b/paddle/fluid/framework/block_desc.cc index 9f753478d..1b6f656a0 100644 --- a/paddle/fluid/framework/block_desc.cc +++ b/paddle/fluid/framework/block_desc.cc @@ -143,7 +143,7 @@ OpDesc *BlockDesc::InsertOp(size_t index) { } void BlockDesc::RemoveOp(size_t s, size_t e) { - if (ops_.begin() + s == ops_.end() || ops_.begin() + e == ops_.end()) { + if (ops_.begin() + s >= ops_.end() || ops_.begin() + e > ops_.end()) { return; } need_update_ = true; -- GitLab