Compile now can attach arbitrary data to an entry (#2634)

This commit is contained in:
Angelos Katharopoulos
2025-09-30 13:33:27 -07:00
committed by GitHub
parent dc371ae7a5
commit eb24267b56
5 changed files with 130 additions and 31 deletions

View File

@@ -579,11 +579,11 @@ void FunctionExporter::export_function(const Args& args, const Kwargs& kwargs) {
for (auto& k : kwarg_keys) {
kwargs.insert({k, *it++});
}
return fun(args, kwargs);
return detail::ArraysAndExtra{fun(args, kwargs), nullptr};
};
// Trace to build the graph
auto [trace_inputs, trace_outputs] =
auto [trace_inputs, trace_outputs, extra] =
detail::compile_trace(flat_fun, inputs, ftable->shapeless);
// DFS the graph and get the tape