powered by
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)
Tensor pointer
GGML context
Data type (GGML_TYPE_F32, etc.)
Number of dimensions (1-4)
Numeric vector of dimension sizes
# \donttest{ ctx <- ggml_init(1024 * 1024) t <- ggml_new_tensor(ctx, GGML_TYPE_F32, 3, c(10, 20, 30)) ggml_nelements(t) ggml_free(ctx) # }
Run the code above in your browser using DataLab