Skip to content

Commit

Permalink
Make sure fenced tensor could not reuse other tensor. (#2561)
Browse files Browse the repository at this point in the history
Fix random error caused by this.
  • Loading branch information
zhanghuanrong authored and yufenglee committed Dec 11, 2019
1 parent b2d65b4 commit 6859d92
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions onnxruntime/core/framework/allocation_planner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ class PlannerImpl {
auto p_required_buffer_shape = context_.GetShape(output_arg);
if (nullptr == p_required_buffer_shape) return false;
auto& required_memory_info = AllocPlan(output_arg.Name()).location;
if (HasFence(&output_arg)) return false;

for (auto it = freelist_.begin(); it != freelist_.end(); ++it) {
size_t reusable = static_cast<size_t>(it->ml_value);
Expand Down

0 comments on commit 6859d92

Please sign in to comment.