ggml_view_4d: 4D View with Byte Offset (Graph)

View source: R/operations.R

ggml_view_4dR Documentation

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)

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

Value

View tensor


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