Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix a bug in CachedOp. (#11675)
Browse files Browse the repository at this point in the history
* fix a bug.

* add tests.

* use default context.

* move all tests to test_contrib_control_flow.py

* fix test.
  • Loading branch information
zheng-da authored and eric-haibin-lin committed Jul 21, 2018
1 parent 11b69f2 commit 6798703
Show file tree
Hide file tree
Showing 4 changed files with 539 additions and 531 deletions.
10 changes: 5 additions & 5 deletions src/imperative/imperative_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -963,13 +963,13 @@ inline void CreateEngineOpSeg(
seg_execs.push_back(exec);

auto& seg = (*opr_segs)[nid];
if (is_async) {
seg = EngineOprSeg{false, nid + 1};
seg.opr.reset(CreateEngineOp(default_ctx, seg_execs));
if (!valid) {
seg = EngineOprSeg{false, nid + 1, nullptr};
seg_execs.clear();
seg_start = nid + 1;
} else if (!valid) {
seg = EngineOprSeg{false, nid + 1, nullptr};
} else if (is_async) {
seg = EngineOprSeg{false, nid + 1};
seg.opr.reset(CreateEngineOp(default_ctx, seg_execs));
seg_execs.clear();
seg_start = nid + 1;
}
Expand Down
Loading

0 comments on commit 6798703

Please sign in to comment.