Skip to content

Commit 2d98a41

Browse files
author
Yancey
authored
fix remove op (#10410)
* fix remove op * update
1 parent 0285a2b commit 2d98a41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paddle/fluid/framework/block_desc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ OpDesc *BlockDesc::InsertOp(size_t index) {
143143
}
144144

145145
void BlockDesc::RemoveOp(size_t s, size_t e) {
146-
if (ops_.begin() + s == ops_.end() || ops_.begin() + e == ops_.end()) {
146+
if (ops_.begin() + s >= ops_.end() || ops_.begin() + e > ops_.end()) {
147147
return;
148148
}
149149
need_update_ = true;

0 commit comments

Comments
 (0)