2024-10-15 23:12:17 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en-US" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=11" / >
< meta name = "generator" content = "Doxygen 1.12.0" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > MLX: mlx/io.h File Reference< / title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "dynsections.js" > < / script >
< script type = "text/javascript" src = "clipboard.js" > < / script >
< link href = "navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "resize.js" > < / script >
< script type = "text/javascript" src = "cookie.js" > < / script >
< link href = "search/search.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "search/searchdata.js" > < / script >
< script type = "text/javascript" src = "search/search.js" > < / script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr id = "projectrow" >
< td id = "projectalign" >
< div id = "projectname" > MLX
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
< / script >
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
< / script >
< script type = "text/javascript" src = "menudata.js" > < / script >
< script type = "text/javascript" src = "menu.js" > < / script >
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',false);
$(function() { init_search(); });
});
/* @license-end */
< / script >
< div id = "main-nav" > < / div >
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
< / script >
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
< / div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
< div id = "MSearchResults" >
< div class = "SRPage" >
< div id = "SRIndex" >
< div id = "SRResults" > < / div >
< div class = "SRStatus" id = "Loading" > Loading...< / div >
< div class = "SRStatus" id = "Searching" > Searching...< / div >
< div class = "SRStatus" id = "NoMatches" > No Matches< / div >
< / div >
< / div >
< / div >
< / div >
< div id = "nav-path" class = "navpath" >
< ul >
< li class = "navelem" > < a class = "el" href = "dir_938ab0ecf10b8b860ff766c820f665fd.html" > mlx< / a > < / li > < / ul >
< / div >
< / div > <!-- top -->
< div id = "doc-content" >
< div class = "header" >
< div class = "summary" >
< a href = "#namespaces" > Namespaces< / a > |
< a href = "#typedef-members" > Typedefs< / a > |
< a href = "#func-members" > Functions< / a > < / div >
< div class = "headertitle" > < div class = "title" > io.h File Reference< / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
2024-12-07 05:22:39 +08:00
< div class = "textblock" > < code > #include < unordered_map> < / code > < br / >
< code > #include < variant> < / code > < br / >
2024-10-15 23:12:17 +08:00
< code > #include " < a class = "el" href = "array_8h_source.html" > mlx/array.h< / a > " < / code > < br / >
< code > #include " < a class = "el" href = "io_2load_8h_source.html" > mlx/io/load.h< / a > " < / code > < br / >
< code > #include " < a class = "el" href = "stream_8h_source.html" > mlx/stream.h< / a > " < / code > < br / >
< code > #include " < a class = "el" href = "utils_8h_source.html" > mlx/utils.h< / a > " < / code > < br / >
< / div >
< p > < a href = "io_8h_source.html" > Go to the source code of this file.< / a > < / p >
< table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "namespaces" name = "namespaces" > < / a >
Namespaces< / h2 > < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > namespace   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx.html" > mlx< / a > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > namespace   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html" > mlx::core< / a > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "typedef-members" name = "typedef-members" > < / a >
Typedefs< / h2 > < / td > < / tr >
< tr class = "memitem:a8c2c1b9a37aadfb48f4c3a7e806e32e3" id = "r_a8c2c1b9a37aadfb48f4c3a7e806e32e3" > < td class = "memItemLeft" align = "right" valign = "top" > using  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#a8c2c1b9a37aadfb48f4c3a7e806e32e3" > mlx::core::GGUFMetaData< / a > < / td > < / tr >
< tr class = "separator:a8c2c1b9a37aadfb48f4c3a7e806e32e3" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:aa5b0f7f13a941e1f41c411194e9033c7" id = "r_aa5b0f7f13a941e1f41c411194e9033c7" > < td class = "memItemLeft" align = "right" valign = "top" > using  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#aa5b0f7f13a941e1f41c411194e9033c7" > mlx::core::GGUFLoad< / a > < / td > < / tr >
< tr class = "separator:aa5b0f7f13a941e1f41c411194e9033c7" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a688cd7917b1365065e8059e9964c3d45" id = "r_a688cd7917b1365065e8059e9964c3d45" > < td class = "memItemLeft" align = "right" valign = "top" > using  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#a688cd7917b1365065e8059e9964c3d45" > mlx::core::SafetensorsLoad< / a > < / td > < / tr >
< tr class = "separator:a688cd7917b1365065e8059e9964c3d45" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "func-members" name = "func-members" > < / a >
Functions< / h2 > < / td > < / tr >
< tr class = "memitem:ad4c2cebe9e54582295f98c5a448a1f32" id = "r_ad4c2cebe9e54582295f98c5a448a1f32" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#ad4c2cebe9e54582295f98c5a448a1f32" > mlx::core::save< / a > (std::shared_ptr< < a class = "el" href = "classmlx_1_1core_1_1io_1_1_writer.html" > io::Writer< / a > > out_stream, < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > a)< / td > < / tr >
< tr class = "memdesc:ad4c2cebe9e54582295f98c5a448a1f32" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Save array to out stream in .npy format. < br / > < / td > < / tr >
< tr class = "separator:ad4c2cebe9e54582295f98c5a448a1f32" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a22a37f3e33e0658680f6227bdd2d0b91" id = "r_a22a37f3e33e0658680f6227bdd2d0b91" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#a22a37f3e33e0658680f6227bdd2d0b91" > mlx::core::save< / a > (std::string file, < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > a)< / td > < / tr >
< tr class = "memdesc:a22a37f3e33e0658680f6227bdd2d0b91" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Save array to file in .npy format. < br / > < / td > < / tr >
< tr class = "separator:a22a37f3e33e0658680f6227bdd2d0b91" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:abada9bfa834d7423959362386720f3db" id = "r_abada9bfa834d7423959362386720f3db" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#abada9bfa834d7423959362386720f3db" > mlx::core::load< / a > (std::shared_ptr< < a class = "el" href = "classmlx_1_1core_1_1io_1_1_reader.html" > io::Reader< / a > > in_stream, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:abada9bfa834d7423959362386720f3db" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > < a class = "el" href = "classmlx_1_1core_1_1_load.html" > Load< / a > array from reader in .npy format. < br / > < / td > < / tr >
< tr class = "separator:abada9bfa834d7423959362386720f3db" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ac71a08bf4c052ae3c77e9e89cbea071d" id = "r_ac71a08bf4c052ae3c77e9e89cbea071d" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#ac71a08bf4c052ae3c77e9e89cbea071d" > mlx::core::load< / a > (std::string file, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:ac71a08bf4c052ae3c77e9e89cbea071d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > < a class = "el" href = "classmlx_1_1core_1_1_load.html" > Load< / a > array from file in .npy format. < br / > < / td > < / tr >
< tr class = "separator:ac71a08bf4c052ae3c77e9e89cbea071d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a96cc40e1af8c4626c813ce4859f70a5c" id = "r_a96cc40e1af8c4626c813ce4859f70a5c" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "namespacemlx_1_1core.html#a688cd7917b1365065e8059e9964c3d45" > SafetensorsLoad< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#a96cc40e1af8c4626c813ce4859f70a5c" > mlx::core::load_safetensors< / a > (std::shared_ptr< < a class = "el" href = "classmlx_1_1core_1_1io_1_1_reader.html" > io::Reader< / a > > in_stream, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:a96cc40e1af8c4626c813ce4859f70a5c" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > < a class = "el" href = "classmlx_1_1core_1_1_load.html" > Load< / a > array map from .safetensors file format. < br / > < / td > < / tr >
< tr class = "separator:a96cc40e1af8c4626c813ce4859f70a5c" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:af7eea1682a38d363c56a066321e6d526" id = "r_af7eea1682a38d363c56a066321e6d526" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "namespacemlx_1_1core.html#a688cd7917b1365065e8059e9964c3d45" > SafetensorsLoad< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#af7eea1682a38d363c56a066321e6d526" > mlx::core::load_safetensors< / a > (const std::string & file, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:af7eea1682a38d363c56a066321e6d526" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a9f158db20c2405557f3ebc397e876de8" id = "r_a9f158db20c2405557f3ebc397e876de8" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#a9f158db20c2405557f3ebc397e876de8" > mlx::core::save_safetensors< / a > (std::shared_ptr< < a class = "el" href = "classmlx_1_1core_1_1io_1_1_writer.html" > io::Writer< / a > > in_stream, std::unordered_map< std::string, < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > , std::unordered_map< std::string, std::string > metadata={})< / td > < / tr >
< tr class = "separator:a9f158db20c2405557f3ebc397e876de8" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a21e256d852d587bcdc0827831b2c5c16" id = "r_a21e256d852d587bcdc0827831b2c5c16" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#a21e256d852d587bcdc0827831b2c5c16" > mlx::core::save_safetensors< / a > (std::string file, std::unordered_map< std::string, < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > , std::unordered_map< std::string, std::string > metadata={})< / td > < / tr >
< tr class = "separator:a21e256d852d587bcdc0827831b2c5c16" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a2aa12b351ce559deb14cda0a5292c2ce" id = "r_a2aa12b351ce559deb14cda0a5292c2ce" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "namespacemlx_1_1core.html#aa5b0f7f13a941e1f41c411194e9033c7" > GGUFLoad< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#a2aa12b351ce559deb14cda0a5292c2ce" > mlx::core::load_gguf< / a > (const std::string & file, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:a2aa12b351ce559deb14cda0a5292c2ce" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > < a class = "el" href = "classmlx_1_1core_1_1_load.html" > Load< / a > array map and metadata from .gguf file format. < br / > < / td > < / tr >
< tr class = "separator:a2aa12b351ce559deb14cda0a5292c2ce" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a8bcc29ca8846ec99dce333df4a34dc5f" id = "r_a8bcc29ca8846ec99dce333df4a34dc5f" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core.html#a8bcc29ca8846ec99dce333df4a34dc5f" > mlx::core::save_gguf< / a > (std::string file, std::unordered_map< std::string, < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > array_map, std::unordered_map< std::string, < a class = "el" href = "namespacemlx_1_1core.html#a8c2c1b9a37aadfb48f4c3a7e806e32e3" > GGUFMetaData< / a > > meta_data={})< / td > < / tr >
< tr class = "separator:a8bcc29ca8846ec99dce333df4a34dc5f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< / div > <!-- contents -->
<!-- start footer part -->
< hr class = "footer" / > < address class = "footer" > < small >
Generated by  < a href = "https://www.doxygen.org/index.html" > < img class = "footer" src = "doxygen.svg" width = "104" height = "31" alt = "doxygen" / > < / a > 1.12.0
< / small > < / address >
< / div > <!-- doc - content -->
< / body >
< / html >