| 250 | } |
| 251 | |
| 252 | TfLiteStatus ArenaPlanner::ResolveTensorAllocation(int tensor_index) { |
| 253 | TfLiteTensor& tensor = *graph_info_->tensor(tensor_index); |
| 254 | if (tensor.allocation_type == kTfLiteArenaRw) { |
| 255 | // Skip resolution if the size of the tensor is zero, leaving it as a |
| 256 | // nullptr. |
| 257 | if (allocs_[tensor_index].size != 0) { |
| 258 | TF_LITE_ENSURE_STATUS(arena_.ResolveAlloc(context_, allocs_[tensor_index], |
| 259 | &tensor.data.raw)); |
| 260 | } |
| 261 | } |
| 262 | if (tensor.allocation_type == kTfLiteArenaRwPersistent) { |
| 263 | TF_LITE_ENSURE_STATUS(persistent_arena_.ResolveAlloc( |
| 264 | context_, allocs_[tensor_index], &tensor.data.raw)); |
| 265 | } |
| 266 | return kTfLiteOk; |
| 267 | } |
| 268 | |
| 269 | TfLiteStatus ArenaPlanner::CalculateTensorAllocation(int tensor_index) { |
| 270 | TfLiteTensor& tensor = *graph_info_->tensor(tensor_index); |
nothing calls this directly
no test coverage detected