Learn R Programming

ggmlR (version 0.6.1)

ggml_reshape_2d: Reshape to 2D (Graph)

Description

Reshapes tensor to 2D with shape (ne0, ne1)

Usage

ggml_reshape_2d(ctx, a, ne0, ne1)

Value

Reshaped tensor

Arguments

ctx

GGML context

a

Input tensor

ne0

Size of dimension 0

ne1

Size of dimension 1

Examples

Run this code
# \donttest{
ctx <- ggml_init(16 * 1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 12)
ggml_set_f32(a, 1:12)
result <- ggml_reshape_2d(ctx, a, 3, 4)
ggml_free(ctx)
# }

Run the code above in your browser using DataLab