mirtal-sys 0.1.0

Private native bridge for mirtal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "mirtal/bridge.h"

#include "mlx/graph_utils.h"

#include <fstream>
#include <stdexcept>
#include <string>

namespace mirtal {
void export_graph_dot(const Array& array, rust::Str path) {
  auto native_path = std::string(path.data(), path.size());
  std::ofstream output(native_path);
  if (!output) throw std::runtime_error("MLX graph dump path cannot be opened");
  mx::export_to_dot(output, array.value);
}
}  // namespace mirtal