| ggml_new_tensor | R Documentation |
Generic tensor constructor for creating tensors with 1-4 dimensions. This is more flexible than the ggml_new_tensor_Nd functions.
ggml_new_tensor(ctx, type = GGML_TYPE_F32, n_dims, ne)
ctx |
GGML context |
type |
Data type (GGML_TYPE_F32, etc.) |
n_dims |
Number of dimensions (1-4) |
ne |
Numeric vector of dimension sizes |
Tensor pointer
ctx <- ggml_init(1024 * 1024)
t <- ggml_new_tensor(ctx, GGML_TYPE_F32, 3, c(10, 20, 30))
ggml_nelements(t)
ggml_free(ctx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.