Make sure fenced tensor could not reuse other tensor. (#2561)

Fix random error caused by this.
This commit is contained in:
Zhang Lei 2019-12-11 12:04:54 -08:00 committed by Yufeng Li
parent b2d65b447f
commit 6859d92e2b

View file

@ -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);