| 7 | namespace mlx::core { |
| 8 | |
| 9 | std::filesystem::path current_binary_dir() { |
| 10 | static std::filesystem::path binary_dir = []() { |
| 11 | Dl_info info; |
| 12 | if (!dladdr(reinterpret_cast<void*>(¤t_binary_dir), &info)) { |
| 13 | throw std::runtime_error("Unable to get current binary dir."); |
| 14 | } |
| 15 | return std::filesystem::path(info.dli_fname).parent_path(); |
| 16 | }(); |
| 17 | return binary_dir; |
| 18 | } |
| 19 | |
| 20 | std::tuple<Shape, std::vector<Strides>> collapse_contiguous_dims( |
| 21 | const Shape& shape, |
no outgoing calls
no test coverage detected