Learn R Programming

ggmlR (version 0.6.1)

ggml_cont: Make Contiguous (Graph)

Description

Makes a tensor contiguous in memory. Required after permute/transpose before some operations.

Usage

ggml_cont(ctx, a)

Value

Contiguous tensor

Arguments

ctx

GGML context

a

Input tensor

Examples

Run this code
# \donttest{
ctx <- ggml_init(16 * 1024 * 1024)
a <- ggml_new_tensor_2d(ctx, GGML_TYPE_F32, 3, 4)
ggml_set_f32(a, 1:12)
transposed <- ggml_transpose(ctx, a)
contiguous <- ggml_cont(ctx, transposed)
ggml_free(ctx)
# }

Run the code above in your browser using DataLab