Learn R Programming

ggmlR (version 0.6.1)

ggml_new_f32: Create Scalar F32 Tensor

Description

Creates a 1-element tensor containing a single float value. Useful for scalar operations, learning rates, and other scalar floats.

Usage

ggml_new_f32(ctx, value)

Value

Tensor pointer (1-element F32 tensor)

Arguments

ctx

GGML context

value

Numeric value

Examples

Run this code
# \donttest{
ctx <- ggml_init(1024 * 1024)
scalar <- ggml_new_f32(ctx, 3.14)
ggml_get_f32(scalar)
ggml_free(ctx)
# }

Run the code above in your browser using DataLab