Make sure that arrays are freed when saving (#247)

This commit is contained in:
Angelos Katharopoulos
2023-12-21 14:08:24 -08:00
committed by GitHub
parent b3916cbf2b
commit 2c7df6795e
3 changed files with 17 additions and 8 deletions

View File

@@ -13,9 +13,12 @@ using namespace mlx::core;
using DictOrArray = std::variant<array, std::unordered_map<std::string, array>>;
DictOrArray mlx_load_helper(py::object file, StreamOrDevice s);
void mlx_save_helper(py::object file, array a, bool retain_graph = true);
void mlx_save_helper(
py::object file,
array a,
std::optional<bool> retain_graph = std::nullopt);
void mlx_savez_helper(
py::object file,
py::args args,
const py::kwargs& kwargs,
bool compressed = false);
bool compressed = false);