| GGML_SORT_ORDER_ASC | R Documentation |
Sort Order Constants
GGML_SORT_ORDER_ASC
GGML_SORT_ORDER_DESC
Integer constants
An object of class integer of length 1.
Constants for specifying sort order in argsort operations.
GGML_SORT_ORDER_ASC (0): Ascending order (smallest first)
GGML_SORT_ORDER_DESC (1): Descending order (largest first)
An integer constant representing a sort order
GGML_SORT_ORDER_ASC # 0 - Ascending order
GGML_SORT_ORDER_DESC # 1 - Descending order
# Usage with ggml_argsort
ctx <- ggml_init(1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 5)
ggml_set_f32(a, c(3, 1, 4, 1, 5))
# Get ascending sort indices
idx_asc <- ggml_argsort(ctx, a, GGML_SORT_ORDER_ASC)
# Get descending sort indices
idx_desc <- ggml_argsort(ctx, a, GGML_SORT_ORDER_DESC)
ggml_free(ctx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.