MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_can_repeat

Function ggml_can_repeat

subprojects/llama.cpp/ggml/src/ggml.c:1500–1508  ·  view source on GitHub ↗

check if t1 can be represented as a repetition of t0

Source from the content-addressed store, hash-verified

1498
1499// check if t1 can be represented as a repetition of t0
1500bool ggml_can_repeat(const struct ggml_tensor * t0, const struct ggml_tensor * t1) {
1501 static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");
1502
1503 return ggml_is_empty(t0) ? ggml_is_empty(t1) :
1504 (t1->ne[0]%t0->ne[0] == 0) &&
1505 (t1->ne[1]%t0->ne[1] == 0) &&
1506 (t1->ne[2]%t0->ne[2] == 0) &&
1507 (t1->ne[3]%t0->ne[3] == 0);
1508}
1509
1510static inline bool ggml_can_repeat_rows(const struct ggml_tensor * t0, const struct ggml_tensor * t1) {
1511 static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");

Callers 15

ggml_can_repeat_rowsFunction · 0.85
ggml_add_implFunction · 0.85
ggml_sub_implFunction · 0.85
ggml_mul_implFunction · 0.85
ggml_div_implFunction · 0.85
ggml_repeatFunction · 0.85
ggml_repeat_backFunction · 0.85
bcast_shapeFunction · 0.85
ggml_cann_repeatFunction · 0.85
apply_binary_opFunction · 0.85

Calls 1

ggml_is_emptyFunction · 0.85

Tested by

no test coverage detected