| 32 | }; |
| 33 | |
| 34 | int main() { |
| 35 | mllm::initializeContext(); |
| 36 | { |
| 37 | auto net = FooNet("foo_net"); |
| 38 | |
| 39 | // Make some fake weights |
| 40 | auto params = ParameterFile::create(); |
| 41 | for (int i = 0; i < 4; ++i) { |
| 42 | auto name = "foo_net.linear_" + std::to_string(i); |
| 43 | auto w = Tensor::empty({2048, 1024}).setMemType(kParamsNormal).setName(name + ".weight"); |
| 44 | auto b = Tensor::empty({2048}).setMemType(kParamsNormal).setName(name + ".bias"); |
| 45 | params->push(w.name(), w); |
| 46 | params->push(b.name(), b); |
| 47 | } |
| 48 | net.load(params); |
| 49 | |
| 50 | auto ir_ctx = mllm::ir::trace(net, Tensor::empty({2, 1, 312, 1024}, kFloat32)); |
| 51 | |
| 52 | // Lowering |
| 53 | auto pm = mllm::ir::PassManager(ir_ctx); |
| 54 | pm.reg(mllm::ir::createProgramLoweringPipeline()); |
| 55 | pm.run(); |
| 56 | |
| 57 | print(ir_ctx); |
| 58 | } |
| 59 | mllm::memoryReport(); |
| 60 | } |
nothing calls this directly
no test coverage detected