| ggml_view_1d | R Documentation |
Creates a 1D view of a tensor starting at a byte offset. The view shares memory with the source tensor.
ggml_view_1d(ctx, a, ne0, offset = 0)
ctx |
GGML context |
a |
Source tensor |
ne0 |
Number of elements in the view |
offset |
Byte offset from the start of tensor data |
View tensor
ctx <- ggml_init(16 * 1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 100)
# View elements 10-19 (offset = 10 * 4 bytes = 40)
v <- ggml_view_1d(ctx, a, 10, 40)
ggml_free(ctx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.