Fixed layout infer bug when some op is not in op_vector_ (#676)
Backgroud: instance_norm models run crash after latest lay out code refine Reason: erase() function will delete the last element if the param is vector.end() Solution: Check iterator validtion before erase. Type: Bug Fix Issue: 37449 Signed-off-by: Feiyue Chen <Feiyue.Chen@verisilicon.com>
This commit is contained in:
parent
394cedcfe6
commit
0d8ca44377
|
|
@ -114,7 +114,9 @@ void RemoveTensorsAndOps(
|
|||
[norm_ops, i](std::shared_ptr<vx::Operation> oper) {
|
||||
return oper == norm_ops[i];
|
||||
});
|
||||
graph->OpVector().erase(it); //Remove current op from op_vector_
|
||||
if (it != graph->OpVector().end()) {
|
||||
graph->OpVector().erase(it);
|
||||
} // Remove current op from op_vector_
|
||||
auto input_tensors = norm_ops[i]->impl()->InputsTensor();
|
||||
auto output_tensors = norm_ops[i]->impl()->OutputsTensor();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue