ggml-alloc : fix ggml_tallocr_is_own

This commit is contained in:
Georgi Gerganov 2023-12-22 13:19:55 +02:00
parent f0b2ba2089
commit 5627e0b1f7
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -72,7 +72,7 @@ static void remove_allocated_tensor(ggml_tallocr_t alloc, struct ggml_tensor * t
// check if a tensor is allocated by this buffer
static bool ggml_tallocr_is_own(ggml_tallocr_t alloc, const struct ggml_tensor * tensor) {
return tensor->buffer == alloc->buffer;
return tensor->buffer == alloc->buffer && (!tensor->view_src || tensor->view_src->buffer == alloc->buffer);
}
static bool ggml_is_view(struct ggml_tensor * t) {