modified: ge/graph/passes/replace_with_empty_const_pass.cc

modified:   ge/graph/passes/replace_with_empty_const_pass.h
pull/460/head
zhaoxinxin 4 years ago
parent 60476ce26e
commit 6e8581d0a6

@ -74,9 +74,10 @@ Status ReplaceWithEmptyConstPass::Run(NodePtr &node) {
GELOGD("ReplaceWithEmptyConstPass end."); GELOGD("ReplaceWithEmptyConstPass end.");
return SUCCESS; return SUCCESS;
} }
Status GetOutputsOfCurrNode(const NodePtr &node_to_repalce, vector<GeTensorPtr> &outputs) { Status GetOutputsOfCurrNode(const NodePtr &node_to_replace, vector<GeTensorPtr> &outputs) {
for (const auto &out_anchor : node_to_replace->GetAllOutDataAnchors()) { 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<ge::GeTensor>(out_desc); GeTensorPtr empty_tensor = MakeShared<ge::GeTensor>(out_desc);
GE_CHECK_NOTNULL(empty_tensor); GE_CHECK_NOTNULL(empty_tensor);
outputs.emplace_back(empty_tensor); outputs.emplace_back(empty_tensor);

@ -25,7 +25,7 @@ class ReplaceWithEmptyConstPass : public FoldingPass {
Status Run(NodePtr &node) override; Status Run(NodePtr &node) override;
private: private:
Status GetOutputsOfCurrNode(const NodePtr &node_to_repalce, vector<GeTensorPtr> &outputs); Status GetOutputsOfCurrNode(const NodePtr &node_to_replace, vector<GeTensorPtr> &outputs);
bool IsEmptyTenor(const GeShape &shape) const; bool IsEmptyTenor(const GeShape &shape) const;
}; };
} // namespace ge } // namespace ge

Loading…
Cancel
Save