ggml_graph_node: Get Graph Node

View source: R/graph.R

ggml_graph_nodeR Documentation

Get Graph Node

Description

Gets a specific node (tensor) from the computation graph by index

Usage

ggml_graph_node(graph, i)

Arguments

graph

Graph object

i

Node index (0-based, negative indices count from end)

Value

Tensor pointer

Examples


ctx <- ggml_init(16 * 1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 10)
b <- ggml_add(ctx, a, a)
graph <- ggml_build_forward_expand(ctx, b)
# Get the last node (output)
output <- ggml_graph_node(graph, -1)
ggml_free(ctx)


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