Learn R Programming

ggmlR (version 0.6.1)

ggml_dup_tensor: Duplicate Tensor

Description

Creates a copy of a tensor with the same shape and type

Usage

ggml_dup_tensor(ctx, tensor)

Value

New tensor pointer with same shape

Arguments

ctx

GGML context

tensor

Tensor to duplicate

Examples

Run this code
# \donttest{
ctx <- ggml_init(1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 100)
b <- ggml_dup_tensor(ctx, a)
ggml_nelements(b)
ggml_free(ctx)
# }

Run the code above in your browser using DataLab