| ggml_set_zero | R Documentation |
Sets all elements of a tensor to zero. This is more efficient than manually setting all elements.
ggml_set_zero(tensor)
tensor |
Tensor to zero out |
NULL (invisible)
ctx <- ggml_init(1024 * 1024)
t <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 10)
ggml_set_f32(t, 1:10)
ggml_set_zero(t)
ggml_get_f32(t)
ggml_free(ctx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.