MCPcopy Create free account
hub / github.com/ml-explore/mlx / is_ostream_object

Function is_ostream_object

python/src/load.cpp:39–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool is_ostream_object(const nb::object& file) {
40 return nb::hasattr(file, "write") && nb::hasattr(file, "seek") &&
41 nb::hasattr(file, "tell") && nb::hasattr(file, "closed");
42}
43
44bool is_zip_file(const nb::module_& zipfile, const nb::object& file) {
45 if (is_istream_object(file)) {

Callers 2

mlx_save_helperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected