Ensure the same behaviour as before

This commit is contained in:
Angelos Katharopoulos
2025-09-29 23:39:04 -07:00
parent 7cdb155d17
commit 6faf593775

View File

@@ -1007,6 +1007,14 @@ std::function<std::vector<array>(const std::vector<array>&)> compile(
std::uintptr_t fun_id,
bool shapeless /* = false */,
std::vector<uint64_t> constants /* = {} */) {
if (skip_compile()) {
return fun;
}
if (!fun) {
throw std::invalid_argument(
"[compile] Cannot compile a function without a target.");
}
ArrayFnWithExtra fun_with_extra =
[fun = std::move(fun)](const std::vector<array>& inputs) {
return std::pair<std::vector<array>, std::shared_ptr<void>>{