MCPcopy Create free account
hub / github.com/UbiquitousLearning/mllm / __main

Method __main

mllm/nn/Module.cpp:109–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107void Module::__fmt_print(std::stringstream& ss) const { impl()->__fmt_print(ss); }
108
109std::vector<Tensor> Module::__main(const std::vector<Tensor>& inputs, const std::vector<AnyValue>& args) {
110 auto& ctx = Context::instance();
111 __send_graph_begin(inputs); // used for tracing
112 std::vector<Tensor> o;
113
114 // FIXME: We need to avoid trace_mode condition
115 if (ctx.thisThread()->trace_mode) {
116 o = __trace(inputs, args);
117 } else {
118 auto task = Task::createExecuteModuleTask(this, inputs, args);
119
120 ctx.dispatcherManager()->submit(static_cast<int32_t>(impl_->getDevice()), task);
121
122 // Return what we need.
123 o = task->outputs;
124 }
125 __send_graph_end(inputs); // used for tracing
126 return o;
127}
128
129void Module::__send_graph_begin(const std::vector<Tensor>& inputs) {
130 auto& ctx = Context::instance();

Callers

nothing calls this directly

Calls 4

thisThreadMethod · 0.80
submitMethod · 0.80
dispatcherManagerMethod · 0.80
getDeviceMethod · 0.45

Tested by

no test coverage detected