ggml_graph_dup: Duplicate a Computation Graph

View source: R/graph.R

ggml_graph_dupR Documentation

Duplicate a Computation Graph

Description

Copies graph into ctx. With force_grads = TRUE the copy carries gradient storage even when the original does not, which is one way to turn a plain forward graph into one that ggml_build_backward_expand accepts.

Usage

ggml_graph_dup(ctx, graph, force_grads = FALSE)

Arguments

ctx

GGML context to allocate the copy in

graph

Graph to duplicate

force_grads

Logical; give the copy gradient storage (default FALSE)

Value

A new graph object (external pointer)

See Also

ggml_build_forward_expand_grads


ggmlR documentation built on Oct. 23, 2026, 1:07 a.m.