MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_graph_get_tensor

Function ggml_graph_get_tensor

ggml.c:17493–17511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17491}
17492
17493struct ggml_tensor * ggml_graph_get_tensor(struct ggml_cgraph * cgraph, const char * name) {
17494 for (int i = 0; i < cgraph->n_leafs; i++) {
17495 struct ggml_tensor * leaf = cgraph->leafs[i];
17496
17497 if (strcmp(leaf->name, name) == 0) {
17498 return leaf;
17499 }
17500 }
17501
17502 for (int i = 0; i < cgraph->n_nodes; i++) {
17503 struct ggml_tensor * node = cgraph->nodes[i];
17504
17505 if (strcmp(node->name, name) == 0) {
17506 return node;
17507 }
17508 }
17509
17510 return NULL;
17511}
17512
17513static void ggml_graph_export_leaf(const struct ggml_tensor * tensor, FILE * fout) {
17514 const int64_t * ne = tensor->ne;

Callers 3

ggml_graph_get_node_idxFunction · 0.70
mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected