ggml_reset: Reset GGML Context

View source: R/ggml.R

ggml_resetR Documentation

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)

Arguments

ctx

GGML context pointer

Value

NULL (invisible)

Examples


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)


ggmlR documentation built on July 14, 2026, 1:08 a.m.