Browse Source

modified: ge/graph/passes/replace_with_empty_const_pass.cc

modified:   ge/graph/passes/replace_with_empty_const_pass.h
tags/v1.1.0
zhaoxinxin 3 years ago
parent
commit
6e8581d0a6
2 changed files with 4 additions and 3 deletions
  1. +3
    -2
      ge/graph/passes/replace_with_empty_const_pass.cc
  2. +1
    -1
      ge/graph/passes/replace_with_empty_const_pass.h

+ 3
- 2
ge/graph/passes/replace_with_empty_const_pass.cc View File

@@ -74,9 +74,10 @@ Status ReplaceWithEmptyConstPass::Run(NodePtr &node) {
GELOGD("ReplaceWithEmptyConstPass end.");
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()) {
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);
GE_CHECK_NOTNULL(empty_tensor);
outputs.emplace_back(empty_tensor);


+ 1
- 1
ge/graph/passes/replace_with_empty_const_pass.h View File

@@ -25,7 +25,7 @@ class ReplaceWithEmptyConstPass : public FoldingPass {
Status Run(NodePtr &node) override;

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;
};
} // namespace ge


Loading…
Cancel
Save