| 107 | void Module::__fmt_print(std::stringstream& ss) const { impl()->__fmt_print(ss); } |
| 108 | |
| 109 | std::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 | |
| 129 | void Module::__send_graph_begin(const std::vector<Tensor>& inputs) { |
| 130 | auto& ctx = Context::instance(); |
nothing calls this directly
no test coverage detected