From dccadbe677ea351fd646caf5e242bd8772eea07d Mon Sep 17 00:00:00 2001 From: ysh329 Date: Fri, 21 Aug 2020 16:46:20 +0800 Subject: [PATCH] [PASS][BugFix][cherry-pick] fix remove tf redundant op pass. test=develop (#4158) (#4166) * fix remove tf redundant op pass. test=develop (#4158) * test=develop --- lite/core/mir/elimination/remove_tf_redundant_ops_pass.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lite/core/mir/elimination/remove_tf_redundant_ops_pass.cc b/lite/core/mir/elimination/remove_tf_redundant_ops_pass.cc index 792d27b429..9defc2dacf 100644 --- a/lite/core/mir/elimination/remove_tf_redundant_ops_pass.cc +++ b/lite/core/mir/elimination/remove_tf_redundant_ops_pass.cc @@ -184,6 +184,11 @@ void RemoveTFRedundantOpsPass::RemoveSqueeze2Reshape2Pattern( } } + if (nullptr == reshape2_out_node) { + VLOG(5) << "reshape2_out_node doesn't found, skip now"; + return; + } + // find next inst node of reshape2 VLOG(5) << "reshape2_out_node->outlinks.size():" << reshape2_out_node->outlinks.size() -- GitLab