MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / can_fold_lhs_repeat_use

Function can_fold_lhs_repeat_use

src/framework/runtime/graph_optimizer.cpp:108–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 ggml_can_repeat(repeat_node.src[0], consumer.src[0]);
107}
108
109bool can_fold_lhs_repeat_use(const ggml_tensor & repeat_node, const ggml_tensor & consumer, int src_index) {
110 return src_index == 0 &&
111 is_commutative_elementwise_op(consumer.op) &&
112 repeat_node.src[0] != nullptr &&
113 consumer.src[1] != nullptr &&
114 ggml_are_same_shape(consumer.src[1], &consumer) &&
115 ggml_can_repeat(repeat_node.src[0], consumer.src[1]);
116}
117
118bool is_candidate_two_sided_broadcast_repeat(const ggml_tensor & repeat_node, const ggml_tensor & consumer, int src_index) {

Callers 1

optimize_graphFunction · 0.85

Calls 3

ggml_are_same_shapeFunction · 0.85
ggml_can_repeatFunction · 0.85

Tested by

no test coverage detected