From 6e8581d0a651f0fd6ea12710e85e20675612d4d4 Mon Sep 17 00:00:00 2001 From: zhaoxinxin Date: Mon, 30 Nov 2020 16:39:16 +0800 Subject: [PATCH] modified: ge/graph/passes/replace_with_empty_const_pass.cc modified: ge/graph/passes/replace_with_empty_const_pass.h --- ge/graph/passes/replace_with_empty_const_pass.cc | 5 +++-- ge/graph/passes/replace_with_empty_const_pass.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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