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

Function build_graph

external/ggml/examples/simple/simple-ctx.cpp:51–59  ·  view source on GitHub ↗

build the compute graph to perform a matrix multiplication

Source from the content-addressed store, hash-verified

49
50// build the compute graph to perform a matrix multiplication
51struct ggml_cgraph * build_graph(const simple_model& model) {
52 struct ggml_cgraph * gf = ggml_new_graph(model.ctx);
53
54 // result = a*b^T
55 struct ggml_tensor * result = ggml_mul_mat(model.ctx, model.a, model.b);
56
57 ggml_build_forward_expand(gf, result);
58 return gf;
59}
60
61// compute with backend
62struct ggml_tensor * compute(const simple_model & model) {

Callers 1

computeFunction · 0.70

Calls 3

ggml_new_graphFunction · 0.85
ggml_mul_matFunction · 0.85

Tested by

no test coverage detected