diff --git a/mlx/compile.cpp b/mlx/compile.cpp index 2e671f6f8..b6bd5cc1a 100644 --- a/mlx/compile.cpp +++ b/mlx/compile.cpp @@ -334,7 +334,7 @@ std::vector compile_replace( std::function(const std::vector&)> compile( const std::function(const std::vector&)>& fun, size_t fun_id) { - return [&fun, fun_id](const std::vector& inputs) { + return [fun, fun_id](const std::vector& inputs) { // Find a cache entry with the correct inputs auto& entry = compiler_cache().find(fun_id, inputs);