| 58 | GGML_ASSERT(!"out of allocated_tensors"); |
| 59 | } |
| 60 | static 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 |
no test coverage detected