mlx/mlx/graph_utils.h
Jesper Stemann Andersen e4eeb4e910
Added missing unordered_map includes (#1635)
* Added missing includes in mlx/io.h and mlx/backend/metal/metal.h

* Added additional missing unordered_map includes that fixes build on FreeBSD
2024-12-02 07:03:03 -08:00

32 lines
837 B
C++

// Copyright © 2023 Apple Inc.
#pragma once
#include <unordered_map>
#include "mlx/array.h"
namespace mlx::core {
struct NodeNamer {
std::unordered_map<std::uintptr_t, std::string> names;
const std::string& get_name(const array& x);
};
void print_graph(std::ostream& os, const std::vector<array>& outputs);
template <typename... Arrays, typename = enable_for_arrays_t<Arrays...>>
void print_graph(std::ostream& os, Arrays&&... outputs) {
print_graph(os, std::vector<array>{std::forward<Arrays>(outputs)...});
}
void export_to_dot(std::ostream& os, const std::vector<array>& outputs);
template <typename... Arrays, typename = enable_for_arrays_t<Arrays...>>
void export_to_dot(std::ostream& os, Arrays&&... outputs) {
export_to_dot(os, std::vector<array>{std::forward<Arrays>(outputs)...});
}
} // namespace mlx::core