ggml_reshape_4d: Reshape to 4D (Graph)

View source: R/operations.R

ggml_reshape_4dR Documentation

Reshape to 4D (Graph)

Description

Reshapes tensor to 4D with shape (ne0, ne1, ne2, ne3)

Usage

ggml_reshape_4d(ctx, a, ne0, ne1, ne2, ne3)

Arguments

ctx

GGML context

a

Input tensor

ne0

Size of dimension 0

ne1

Size of dimension 1

ne2

Size of dimension 2

ne3

Size of dimension 3

Value

Reshaped tensor

Examples


ctx <- ggml_init(16 * 1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 120)
ggml_set_f32(a, 1:120)
result <- ggml_reshape_4d(ctx, a, 2, 3, 4, 5)
ggml_free(ctx)


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