ggml_view_1d: 1D View with Byte Offset (Graph)

View source: R/operations.R

ggml_view_1dR Documentation

1D View with Byte Offset (Graph)

Description

Creates a 1D view of a tensor starting at a byte offset. The view shares memory with the source tensor.

Usage

ggml_view_1d(ctx, a, ne0, offset = 0)

Arguments

ctx

GGML context

a

Source tensor

ne0

Number of elements in the view

offset

Byte offset from the start of tensor data

Value

View tensor

Examples


ctx <- ggml_init(16 * 1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 100)
# View elements 10-19 (offset = 10 * 4 bytes = 40)
v <- ggml_view_1d(ctx, a, 10, 40)
ggml_free(ctx)


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