MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ResolveTensorAllocation

Method ResolveTensorAllocation

tensorflow/lite/arena_planner.cc:252–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252TfLiteStatus 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
269TfLiteStatus ArenaPlanner::CalculateTensorAllocation(int tensor_index) {
270 TfLiteTensor& tensor = *graph_info_->tensor(tensor_index);

Callers

nothing calls this directly

Calls 2

ResolveAllocMethod · 0.80
tensorMethod · 0.45

Tested by

no test coverage detected