Learn R Programming

ggmlR (version 0.8.4)

ggml_graph_dup: 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)

Value

A new graph object (external pointer)

Arguments

ctx

GGML context to allocate the copy in

graph

Graph to duplicate

force_grads

Logical; give the copy gradient storage (default FALSE)

See Also

ggml_build_forward_expand_grads