From 1b863732ddd91423b1083626c64fba0523204a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=BE=E9=9B=A8=E9=AD=94=E7=90=86=E6=B2=99?= <lolisa@marisa.moe> Date: Tue, 13 Nov 2018 19:58:28 -0800 Subject: [PATCH] Update fuse_ops.cc (#2102) --- src/relay/pass/fuse_ops.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/relay/pass/fuse_ops.cc b/src/relay/pass/fuse_ops.cc index 9d19d2e6c..54dcdf1e8 100644 --- a/src/relay/pass/fuse_ops.cc +++ b/src/relay/pass/fuse_ops.cc @@ -320,7 +320,7 @@ class DominatorTree { * \param rhs The right node. * \param edge_pattern * The combined edge pattern across all the parents. - * \return The least common acenstor of thw two. + * \return The least common ancestor of thw two. */ static Node* LeastCommonAncestor( Node* lhs, @@ -380,8 +380,7 @@ DominatorTree DominatorTree::PostDom(common::Arena* arena, } pattern = CombinePattern(pattern, link->value.pattern); } - CHECK(parent != nullptr); - tnode->depth = parent->depth + 1; + tnode->depth = parent ? parent->depth + 1 : 1; tnode->parent = parent; tnode->pattern = pattern; } -- GitLab