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

Method CalculateTensorAllocation

tensorflow/lite/arena_planner.cc:269–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269TfLiteStatus ArenaPlanner::CalculateTensorAllocation(int tensor_index) {
270 TfLiteTensor& tensor = *graph_info_->tensor(tensor_index);
271 if (tensor.allocation_type == kTfLiteArenaRw) {
272 TF_LITE_ENSURE_STATUS(arena_.Allocate(
273 context_, tensor_alignment_, tensor.bytes, &allocs_[tensor_index]));
274 }
275 if (tensor.allocation_type == kTfLiteArenaRwPersistent) {
276 TF_LITE_ENSURE_STATUS(persistent_arena_.Allocate(
277 context_, tensor_alignment_, tensor.bytes, &allocs_[tensor_index]));
278 }
279 return kTfLiteOk;
280}
281
282TfLiteStatus ArenaPlanner::CalculateTensorDeallocation(int tensor_index) {
283 TfLiteTensor& tensor = *graph_info_->tensor(tensor_index);

Callers

nothing calls this directly

Calls 2

tensorMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected