diff --git a/ge/graph/passes/replace_with_empty_const_pass.cc b/ge/graph/passes/replace_with_empty_const_pass.cc index 2334daac..bf407914 100644 --- a/ge/graph/passes/replace_with_empty_const_pass.cc +++ b/ge/graph/passes/replace_with_empty_const_pass.cc @@ -74,9 +74,10 @@ Status ReplaceWithEmptyConstPass::Run(NodePtr &node) { GELOGD("ReplaceWithEmptyConstPass end."); return SUCCESS; } -Status GetOutputsOfCurrNode(const NodePtr &node_to_repalce, vector &outputs) { +Status GetOutputsOfCurrNode(const NodePtr &node_to_replace, vector &outputs) { for (const auto &out_anchor : node_to_replace->GetAllOutDataAnchors()) { - auto out_desc = op_desc->GetOutputDesc(out_anchor->GetIdx()); + GE_CHECK_NOTNULL(node_to_replace->GetOpDesc()); + auto out_desc = node_to_replace->GetOpDesc()->GetOutputDesc(out_anchor->GetIdx()); GeTensorPtr empty_tensor = MakeShared(out_desc); GE_CHECK_NOTNULL(empty_tensor); outputs.emplace_back(empty_tensor); diff --git a/ge/graph/passes/replace_with_empty_const_pass.h b/ge/graph/passes/replace_with_empty_const_pass.h index 3b2f0a2d..fde75358 100644 --- a/ge/graph/passes/replace_with_empty_const_pass.h +++ b/ge/graph/passes/replace_with_empty_const_pass.h @@ -25,7 +25,7 @@ class ReplaceWithEmptyConstPass : public FoldingPass { Status Run(NodePtr &node) override; private: - Status GetOutputsOfCurrNode(const NodePtr &node_to_repalce, vector &outputs); + Status GetOutputsOfCurrNode(const NodePtr &node_to_replace, vector &outputs); bool IsEmptyTenor(const GeShape &shape) const; }; } // namespace ge