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

Function ggml_graph_get_parent

ggml.c:18044–18054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18042}
18043
18044static struct ggml_tensor * ggml_graph_get_parent(const struct ggml_cgraph * cgraph, const struct ggml_tensor * node) {
18045 for (int i = 0; i < cgraph->n_nodes; i++) {
18046 struct ggml_tensor * parent = cgraph->nodes[i];
18047
18048 if (parent->grad == node) {
18049 return parent;
18050 }
18051 }
18052
18053 return NULL;
18054}
18055
18056static void ggml_graph_dump_dot_node_edge(FILE * fp, const struct ggml_cgraph * gb, struct ggml_tensor * node, struct ggml_tensor * parent, const char * label) {
18057 struct ggml_tensor * gparent = ggml_graph_get_parent(gb, node);

Callers 2

ggml_graph_dump_dotFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected