Learn R Programming

ggmlR (version 0.6.1)

ggml_reset: Reset GGML Context

Description

Clears all tensor allocations in the context memory pool. The context can be reused without recreating it. This is more efficient than free + init for temporary operations.

Usage

ggml_reset(ctx)

Value

NULL (invisible)

Arguments

ctx

GGML context pointer

Examples

Run this code
# \donttest{
ctx <- ggml_init(1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 100)
ggml_reset(ctx)
b <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 200)
ggml_free(ctx)
# }

Run the code above in your browser using DataLab