mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Ensure the same behaviour as before
This commit is contained in:
@@ -1007,6 +1007,14 @@ std::function<std::vector<array>(const std::vector<array>&)> compile(
|
|||||||
std::uintptr_t fun_id,
|
std::uintptr_t fun_id,
|
||||||
bool shapeless /* = false */,
|
bool shapeless /* = false */,
|
||||||
std::vector<uint64_t> constants /* = {} */) {
|
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 =
|
ArrayFnWithExtra fun_with_extra =
|
||||||
[fun = std::move(fun)](const std::vector<array>& inputs) {
|
[fun = std::move(fun)](const std::vector<array>& inputs) {
|
||||||
return std::pair<std::vector<array>, std::shared_ptr<void>>{
|
return std::pair<std::vector<array>, std::shared_ptr<void>>{
|
||||||
|
|||||||
Reference in New Issue
Block a user