ggml_dup_tensor: Duplicate Tensor

View source: R/tensors.R

ggml_dup_tensorR Documentation

Duplicate Tensor

Description

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

Usage

ggml_dup_tensor(ctx, tensor)

Arguments

ctx

GGML context

tensor

Tensor to duplicate

Value

New tensor pointer with same shape

Examples


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)


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