| 18042 | } |
| 18043 | |
| 18044 | static 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 | |
| 18056 | static 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); |
no outgoing calls
no test coverage detected