From 315ad6f737a9f344b160783d86da4b68751146d6 Mon Sep 17 00:00:00 2001 From: Alan Kelly Date: Tue, 12 Sep 2023 05:49:56 -0700 Subject: [PATCH] Fill refcounts with zeros so that arena memory may be properly shared. PiperOrigin-RevId: 564693001 --- tensorflow/lite/arena_planner.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/lite/arena_planner.cc b/tensorflow/lite/arena_planner.cc index 549c447f741..b63c682d7cb 100644 --- a/tensorflow/lite/arena_planner.cc +++ b/tensorflow/lite/arena_planner.cc @@ -209,7 +209,7 @@ TfLiteStatus ArenaPlanner::PlanAllocations() { std::max(graph_info_->num_execution_nodes(), (size_t)1), {}); // Keeps track of references to each tensor. - refcounts_.resize(num_tensors, 0); + refcounts_.assign(num_tensors, 0); auto allocate = [this](int node, int tensor) -> TfLiteStatus { if (alloc_node_[tensor] != kNodeNotAssigned) { -- GitLab