Learn R Programming

ggmlR (version 0.6.1)

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

Value

View tensor

Arguments

ctx

GGML context

a

Source tensor

ne0

Number of elements in the view

offset

Byte offset from the start of tensor data

Examples

Run this code
# \donttest{
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)
# }

Run the code above in your browser using DataLab