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.
ggml_view_4d(ctx, a, ne0, ne1, ne2, ne3, nb1, nb2, nb3, offset = 0)View tensor
GGML context
Source tensor
Size of dimension 0
Size of dimension 1
Size of dimension 2
Size of dimension 3
Stride for dimension 1 (in bytes)
Stride for dimension 2 (in bytes)
Stride for dimension 3 (in bytes)
Byte offset from the start of tensor data