Learn R Programming

ggmlR (version 0.6.1)

ggml_view_4d: 4D View with Byte Offset (Graph)

Description

Creates a 4D view of a tensor starting at a byte offset. The view shares memory with the source tensor. CRITICAL for KV-cache operations in transformers.

Usage

ggml_view_4d(ctx, a, ne0, ne1, ne2, ne3, nb1, nb2, nb3, offset = 0)

Value

View tensor

Arguments

ctx

GGML context

a

Source tensor

ne0

Size of dimension 0

ne1

Size of dimension 1

ne2

Size of dimension 2

ne3

Size of dimension 3

nb1

Stride for dimension 1 (in bytes)

nb2

Stride for dimension 2 (in bytes)

nb3

Stride for dimension 3 (in bytes)

offset

Byte offset from the start of tensor data