提交 d868a0a1 编写于 作者: D dolphin8 提交者: GitHub

Merge pull request #444 from dolphin8/develop

fix #443 fix dep analysis
......@@ -28,14 +28,6 @@ class depCore {
const std::vector<std::shared_ptr<framework::OperatorBase<Dtype>>>& ops) {
std::unordered_map<std::string, int> vars;
size_t nop = ops.size();
for (size_t i = 0; i < nop; i++) {
const auto& op = ops[i];
for (const auto& kv : op->Outputs()) {
for (const auto& v : kv.second) {
vars[v] = i;
}
}
}
deps.resize(nop);
next.resize(nop);
for (size_t i = 0; i < nop; i++) {
......@@ -56,6 +48,11 @@ class depCore {
next[di].push_back(i);
}
}
for (const auto& kv : op->Outputs()) {
for (const auto& v : kv.second) {
vars[v] = i;
}
}
}
}
const std::vector<int>& getNext(int i) { return next[i]; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册