Skip to content

Place to deinitialize tensor->extra after graph execution #10429

Answered by slaren
marty1885 asked this question in Q&A
Discussion options

You must be logged in to vote

You need to keep track of the tensor extras and free all of them when reset is called. Most likely you will want to keep a pool of available extras and reuse them to avoid expensive allocations when initializing tensors.

        // (optional) reset any internal state due to tensor initialization, such as tensor extras
        void         (*reset)        (ggml_backend_buffer_t buffer);

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@marty1885
Comment options

@slaren
Comment options

@marty1885
Comment options

Answer selected by marty1885
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants