| ggml_can_repeat | R Documentation |
Check if tensor a can be repeated (broadcast) to match tensor b.
Used for broadcasting operations.
ggml_can_repeat(a, b)
a |
Source tensor (smaller) |
b |
Target tensor (larger or same size) |
Logical indicating if a can be repeated to match b
Other tensor_layout:
ggml_are_same_stride(),
ggml_count_equal(),
ggml_is_contiguous_0(),
ggml_is_contiguous_1(),
ggml_is_contiguous_2(),
ggml_is_contiguous_channels(),
ggml_is_contiguous_rows(),
ggml_is_contiguously_allocated()
ctx <- ggml_init(1024 * 1024)
a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 4)
b <- ggml_new_tensor_2d(ctx, GGML_TYPE_F32, 4, 8)
ggml_can_repeat(a, b) # TRUE - a can broadcast along dim 1
ggml_free(ctx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.