MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / remove_allocated_tensor

Function remove_allocated_tensor

ggml-alloc.c:60–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 GGML_ASSERT(!"out of allocated_tensors");
59}
60static void remove_allocated_tensor(ggml_tallocr_t alloc, struct ggml_tensor * tensor) {
61 for (int i = 0; i < 1024; i++) {
62 if (alloc->allocated_tensors[i] == tensor ||
63 (alloc->allocated_tensors[i] != NULL && alloc->allocated_tensors[i]->data == tensor->data)) {
64 alloc->allocated_tensors[i] = NULL;
65 return;
66 }
67 }
68 printf("tried to free tensor %s not found\n", tensor->name);
69 GGML_ASSERT(!"tensor not found");
70}
71#endif
72
73// check if a tensor is allocated by this buffer

Callers 1

ggml_tallocr_free_tensorFunction · 0.70

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected