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" / >
2025-02-07 04:16:29 +08:00
< meta name = "generator" content = "Doxygen 1.13.2" / >
2024-10-15 23:12:17 +08:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > MLX: mlx/random.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" / >
2025-01-10 05:56:20 +08:00
< script type = "text/javascript" src = "navtreedata.js" > < / script >
< script type = "text/javascript" src = "navtree.js" > < / script >
2024-10-15 23:12:17 +08:00
< 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 >
2025-01-10 05:56:20 +08:00
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
$(function() { init_search(); });
/* @license-end */
< / script >
2024-10-15 23:12:17 +08:00
< 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 >
2025-01-10 05:56:20 +08:00
< td > < div id = "MSearchBox" class = "MSearchBoxInactive" >
< span class = "left" >
< span id = "MSearchSelect" onmouseover = "return searchBox.OnSearchSelectShow()" onmouseout = "return searchBox.OnSearchSelectHide()" >   < / span >
< input type = "text" id = "MSearchField" value = "" placeholder = "Search" accesskey = "S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
< / span > < span class = "right" >
< a id = "MSearchClose" href = "javascript:searchBox.CloseResultsWindow()" > < img id = "MSearchCloseImg" border = "0" src = "search/close.svg" alt = "" / > < / a >
< / span >
< / div >
< / td >
2024-10-15 23:12:17 +08:00
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2025-02-07 04:16:29 +08:00
<!-- Generated by Doxygen 1.13.2 -->
2024-10-15 23:12:17 +08:00
< 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 >
2025-01-10 05:56:20 +08:00
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
< / div >
< / div >
2024-10-15 23:12:17 +08:00
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2025-01-10 05:56:20 +08:00
$(function(){initNavTree('random_8h.html',''); initResizable(true); });
2024-10-15 23:12:17 +08:00
/* @license-end */
< / script >
2025-01-10 05:56:20 +08:00
< div id = "doc-content" >
2024-10-15 23:12:17 +08:00
<!-- 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 class = "header" >
< div class = "summary" >
< a href = "#nested-classes" > Classes< / a > |
< a href = "#namespaces" > Namespaces< / a > |
< a href = "#func-members" > Functions< / a > < / div >
< div class = "headertitle" > < div class = "title" > random.h File Reference< / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< div class = "textblock" > < code > #include < chrono> < / code > < br / >
< code > #include < optional> < / code > < br / >
< code > #include " < a class = "el" href = "array_8h_source.html" > mlx/array.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 = "random_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 = "nested-classes" name = "nested-classes" > < / a >
Classes< / h2 > < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > class   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classmlx_1_1core_1_1random_1_1_key_sequence.html" > mlx::core::random::KeySequence< / 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 = "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 >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > namespace   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core_1_1random.html" > mlx::core::random< / 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 = "func-members" name = "func-members" > < / a >
Functions< / h2 > < / td > < / tr >
< tr class = "memitem:acf04b6f42de11383e86dcc7f98c67bd8" id = "r_acf04b6f42de11383e86dcc7f98c67bd8" > < 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_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > mlx::core::random::key< / a > (uint64_t < a class = "el" href = "namespacemlx_1_1core_1_1random.html#ac4ad325b613257306df74595d3d0e23b" > seed< / a > )< / td > < / tr >
< tr class = "memdesc:acf04b6f42de11383e86dcc7f98c67bd8" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Get a PRNG key from a seed. < br / > < / td > < / tr >
< tr class = "separator:acf04b6f42de11383e86dcc7f98c67bd8" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ac4ad325b613257306df74595d3d0e23b" id = "r_ac4ad325b613257306df74595d3d0e23b" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core_1_1random.html#ac4ad325b613257306df74595d3d0e23b" > mlx::core::random::seed< / a > (uint64_t seed)< / td > < / tr >
< tr class = "memdesc:ac4ad325b613257306df74595d3d0e23b" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Seed the default PRNG key. < br / > < / td > < / tr >
< tr class = "separator:ac4ad325b613257306df74595d3d0e23b" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2025-01-10 05:56:20 +08:00
< tr class = "memitem:ad7d1c0b530906538dd8fb31b17382f2b" id = "r_ad7d1c0b530906538dd8fb31b17382f2b" > < 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_1_1random.html#ad7d1c0b530906538dd8fb31b17382f2b" > mlx::core::random::bits< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, int width, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:ad7d1c0b530906538dd8fb31b17382f2b" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate an array with type uint32 filled with random bits. < br / > < / td > < / tr >
< tr class = "separator:ad7d1c0b530906538dd8fb31b17382f2b" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a035d36774135faabad33d8f64a879df7" id = "r_a035d36774135faabad33d8f64a879df7" > < 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_1_1random.html#a035d36774135faabad33d8f64a879df7" > mlx::core::random::bits< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a035d36774135faabad33d8f64a879df7" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2024-10-15 23:12:17 +08:00
< tr class = "memitem:a42847b435d037a977592e355eed072af" id = "r_a42847b435d037a977592e355eed072af" > < td class = "memItemLeft" align = "right" valign = "top" > std::pair< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > , < 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_1_1random.html#a42847b435d037a977592e355eed072af" > mlx::core::random::split< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > , < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:a42847b435d037a977592e355eed072af" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > < a class = "el" href = "classmlx_1_1core_1_1_split.html" > Split< / a > the rng key into a pair of keys. < br / > < / td > < / tr >
< tr class = "separator:a42847b435d037a977592e355eed072af" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a7ec057064c7326c41b536f08178861e5" id = "r_a7ec057064c7326c41b536f08178861e5" > < 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_1_1random.html#a7ec057064c7326c41b536f08178861e5" > mlx::core::random::split< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > , int num, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:a7ec057064c7326c41b536f08178861e5" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > < a class = "el" href = "classmlx_1_1core_1_1_split.html" > Split< / a > the rng key into < code > num< / code > keys. < br / > < / td > < / tr >
< tr class = "separator:a7ec057064c7326c41b536f08178861e5" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2025-01-10 05:56:20 +08:00
< tr class = "memitem:ac461a0be91e448c9887b38b832c61cc2" id = "r_ac461a0be91e448c9887b38b832c61cc2" > < 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_1_1random.html#ac461a0be91e448c9887b38b832c61cc2" > mlx::core::random::uniform< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & low, const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & high, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype=< a class = "el" href = "namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319" > float32< / a > , const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:ac461a0be91e448c9887b38b832c61cc2" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate uniform random numbers between low and high. < br / > < / td > < / tr >
< tr class = "separator:ac461a0be91e448c9887b38b832c61cc2" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:abe65438fbb52624386f50f77863a2c5e" id = "r_abe65438fbb52624386f50f77863a2c5e" > < td class = "memTemplParams" colspan = "2" > template< typename T, typename U> < / td > < / tr >
< tr class = "memitem:abe65438fbb52624386f50f77863a2c5e" > < td class = "memTemplItemLeft" align = "right" valign = "top" > < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a >   < / td > < td class = "memTemplItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core_1_1random.html#abe65438fbb52624386f50f77863a2c5e" > mlx::core::random::uniform< / a > (T low, U high, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype=< a class = "el" href = "namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319" > float32< / a > , const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:abe65438fbb52624386f50f77863a2c5e" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a52913f952387ee3943b3c1f572583ac0" id = "r_a52913f952387ee3943b3c1f572583ac0" > < 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_1_1random.html#a52913f952387ee3943b3c1f572583ac0" > mlx::core::random::uniform< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:a52913f952387ee3943b3c1f572583ac0" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate uniform random numbers between 0 and 1. < br / > < / td > < / tr >
< tr class = "separator:a52913f952387ee3943b3c1f572583ac0" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a0ffb2f91da490f372f898ca2f82104a8" id = "r_a0ffb2f91da490f372f898ca2f82104a8" > < 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_1_1random.html#a0ffb2f91da490f372f898ca2f82104a8" > mlx::core::random::uniform< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a0ffb2f91da490f372f898ca2f82104a8" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a6ec2c08e63d379594b0744cfc7d8dc41" id = "r_a6ec2c08e63d379594b0744cfc7d8dc41" > < 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_1_1random.html#a6ec2c08e63d379594b0744cfc7d8dc41" > mlx::core::random::normal< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype, const float loc, const float scale, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:a6ec2c08e63d379594b0744cfc7d8dc41" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate samples from the standard normal distribution. < br / > < / td > < / tr >
< tr class = "separator:a6ec2c08e63d379594b0744cfc7d8dc41" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a34c5efe846c68b62e65cdb26803d609c" id = "r_a34c5efe846c68b62e65cdb26803d609c" > < 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_1_1random.html#a34c5efe846c68b62e65cdb26803d609c" > mlx::core::random::normal< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const float loc, const float scale, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a34c5efe846c68b62e65cdb26803d609c" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a980b9805dac939e80c2915f0046e6dee" id = "r_a980b9805dac939e80c2915f0046e6dee" > < 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_1_1random.html#a980b9805dac939e80c2915f0046e6dee" > mlx::core::random::normal< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a980b9805dac939e80c2915f0046e6dee" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a1df350be44a32e2eefdd60bb21811246" id = "r_a1df350be44a32e2eefdd60bb21811246" > < 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_1_1random.html#a1df350be44a32e2eefdd60bb21811246" > mlx::core::random::normal< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a1df350be44a32e2eefdd60bb21811246" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ae6a8407fbca0817a4b8c94e02952f77d" id = "r_ae6a8407fbca0817a4b8c94e02952f77d" > < 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_1_1random.html#ae6a8407fbca0817a4b8c94e02952f77d" > mlx::core::random::multivariate_normal< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & < a class = "el" href = "group__ops.html#gade46e768fd46b8b640eb16f26abeecef" > mean< / a > , const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & cov, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:ae6a8407fbca0817a4b8c94e02952f77d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate samples from a multivariate normal distribution. < br / > < / td > < / tr >
< tr class = "separator:ae6a8407fbca0817a4b8c94e02952f77d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ad7dc7ec016e0441749cf94325d624fba" id = "r_ad7dc7ec016e0441749cf94325d624fba" > < 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_1_1random.html#ad7dc7ec016e0441749cf94325d624fba" > mlx::core::random::randint< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & low, const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & high, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype=< a class = "el" href = "namespacemlx_1_1core.html#a5d6373aad1444edc9de1eb07bfe5cad3" > int32< / a > , const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:ad7dc7ec016e0441749cf94325d624fba" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate integer samples uniformly at random. < br / > < / td > < / tr >
< tr class = "separator:ad7dc7ec016e0441749cf94325d624fba" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a286295f9eba91eb2505f855636763add" id = "r_a286295f9eba91eb2505f855636763add" > < td class = "memTemplParams" colspan = "2" > template< typename T, typename U> < / td > < / tr >
< tr class = "memitem:a286295f9eba91eb2505f855636763add" > < td class = "memTemplItemLeft" align = "right" valign = "top" > < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a >   < / td > < td class = "memTemplItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core_1_1random.html#a286295f9eba91eb2505f855636763add" > mlx::core::random::randint< / a > (T low, U high, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype=< a class = "el" href = "namespacemlx_1_1core.html#a5d6373aad1444edc9de1eb07bfe5cad3" > int32< / a > , const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a286295f9eba91eb2505f855636763add" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a1c601b637f60071dfc85cad19a841744" id = "r_a1c601b637f60071dfc85cad19a841744" > < 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_1_1random.html#a1c601b637f60071dfc85cad19a841744" > mlx::core::random::bernoulli< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & p, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:a1c601b637f60071dfc85cad19a841744" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate binary variables with probability to be true equal to p. < br / > < / td > < / tr >
< tr class = "separator:a1c601b637f60071dfc85cad19a841744" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2024-10-15 23:12:17 +08:00
< tr class = "memitem:aaa49f6c2af5496822fa09435e54275cb" id = "r_aaa49f6c2af5496822fa09435e54275cb" > < 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_1_1random.html#aaa49f6c2af5496822fa09435e54275cb" > mlx::core::random::bernoulli< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & p, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:aaa49f6c2af5496822fa09435e54275cb" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2025-01-10 05:56:20 +08:00
< tr class = "memitem:aa9e360f9cb7bd23221352ed9e31d83c2" id = "r_aa9e360f9cb7bd23221352ed9e31d83c2" > < td class = "memTemplParams" colspan = "2" > template< typename T> < / td > < / tr >
2024-10-15 23:12:17 +08:00
< tr class = "memitem:aa9e360f9cb7bd23221352ed9e31d83c2" > < td class = "memTemplItemLeft" align = "right" valign = "top" > < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a >   < / td > < td class = "memTemplItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core_1_1random.html#aa9e360f9cb7bd23221352ed9e31d83c2" > mlx::core::random::bernoulli< / a > (T p, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:aa9e360f9cb7bd23221352ed9e31d83c2" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2025-01-10 05:56:20 +08:00
< tr class = "memitem:a2778876cd2318fec69cd1f3fc0955d68" id = "r_a2778876cd2318fec69cd1f3fc0955d68" > < td class = "memTemplParams" colspan = "2" > template< typename T> < / td > < / tr >
< tr class = "memitem:a2778876cd2318fec69cd1f3fc0955d68" > < td class = "memTemplItemLeft" align = "right" valign = "top" > < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a >   < / td > < td class = "memTemplItemRight" valign = "bottom" > < a class = "el" href = "namespacemlx_1_1core_1_1random.html#a2778876cd2318fec69cd1f3fc0955d68" > mlx::core::random::bernoulli< / a > (T p, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a2778876cd2318fec69cd1f3fc0955d68" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2024-10-15 23:12:17 +08:00
< tr class = "memitem:ad7eb4467e2f9d5f74a5607b29a935b6e" id = "r_ad7eb4467e2f9d5f74a5607b29a935b6e" > < 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_1_1random.html#ad7eb4467e2f9d5f74a5607b29a935b6e" > mlx::core::random::bernoulli< / a > (const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:ad7eb4467e2f9d5f74a5607b29a935b6e" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2025-01-10 05:56:20 +08:00
< tr class = "memitem:aece7dc5a29e0488d8b9648f340dbff72" id = "r_aece7dc5a29e0488d8b9648f340dbff72" > < 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_1_1random.html#aece7dc5a29e0488d8b9648f340dbff72" > mlx::core::random::truncated_normal< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & lower, const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & upper, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype=< a class = "el" href = "namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319" > float32< / a > , const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:aece7dc5a29e0488d8b9648f340dbff72" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2024-10-15 23:12:17 +08:00
< tr class = "memitem:a39663eda0fd7b274d01499a7b1c9035f" id = "r_a39663eda0fd7b274d01499a7b1c9035f" > < 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_1_1random.html#a39663eda0fd7b274d01499a7b1c9035f" > mlx::core::random::truncated_normal< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & lower, const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & upper, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype=< a class = "el" href = "namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319" > float32< / a > , const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a39663eda0fd7b274d01499a7b1c9035f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2025-01-10 05:56:20 +08:00
< tr class = "memitem:a76f81f8f9468039a0b941513b46cb825" id = "r_a76f81f8f9468039a0b941513b46cb825" > < 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_1_1random.html#a76f81f8f9468039a0b941513b46cb825" > mlx::core::random::gumbel< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype=< a class = "el" href = "namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319" > float32< / a > , const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a76f81f8f9468039a0b941513b46cb825" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a1ede4c7f5c86e7b7e834953853ffae9a" id = "r_a1ede4c7f5c86e7b7e834953853ffae9a" > < 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_1_1random.html#a1ede4c7f5c86e7b7e834953853ffae9a" > mlx::core::random::categorical< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & logits, int axis, const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a1ede4c7f5c86e7b7e834953853ffae9a" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2024-10-15 23:12:17 +08:00
< tr class = "memitem:aa7104c436b3972a2480cfeb54554855f" id = "r_aa7104c436b3972a2480cfeb54554855f" > < 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_1_1random.html#aa7104c436b3972a2480cfeb54554855f" > mlx::core::random::categorical< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & logits_, int axis, int num_samples, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:aa7104c436b3972a2480cfeb54554855f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:aa336e774783543705dffe2ad5b2c49c1" id = "r_aa336e774783543705dffe2ad5b2c49c1" > < 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_1_1random.html#aa336e774783543705dffe2ad5b2c49c1" > mlx::core::random::categorical< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & logits, int axis=-1, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:aa336e774783543705dffe2ad5b2c49c1" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2025-01-10 05:56:20 +08:00
< tr class = "memitem:a98ec5406d44ee64537fde896f7da7ce1" id = "r_a98ec5406d44ee64537fde896f7da7ce1" > < 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_1_1random.html#a98ec5406d44ee64537fde896f7da7ce1" > mlx::core::random::laplace< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype, const float loc, const float scale, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "memdesc:a98ec5406d44ee64537fde896f7da7ce1" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate samples from the laplace distribution. < br / > < / td > < / tr >
< tr class = "separator:a98ec5406d44ee64537fde896f7da7ce1" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:aba90074b8a60da9791451c10312bccfa" id = "r_aba90074b8a60da9791451c10312bccfa" > < 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_1_1random.html#aba90074b8a60da9791451c10312bccfa" > mlx::core::random::laplace< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const float loc, const float scale, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:aba90074b8a60da9791451c10312bccfa" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:afa5f7f165b12ec57b1244f347f471bba" id = "r_afa5f7f165b12ec57b1244f347f471bba" > < 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_1_1random.html#afa5f7f165b12ec57b1244f347f471bba" > mlx::core::random::laplace< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const < a class = "el" href = "structmlx_1_1core_1_1_dtype.html" > Dtype< / a > dtype, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:afa5f7f165b12ec57b1244f347f471bba" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a6e80f65fe0f64227fb904fb731c855aa" id = "r_a6e80f65fe0f64227fb904fb731c855aa" > < 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_1_1random.html#a6e80f65fe0f64227fb904fb731c855aa" > mlx::core::random::laplace< / a > (const < a class = "el" href = "namespacemlx_1_1core.html#a694e23f2d59606643728ad443d621416" > Shape< / a > & shape, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a6e80f65fe0f64227fb904fb731c855aa" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2024-10-15 23:12:17 +08:00
< tr class = "memitem:ae4636a5e54c4dcc211d252fe9d97c413" id = "r_ae4636a5e54c4dcc211d252fe9d97c413" > < 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_1_1random.html#ae4636a5e54c4dcc211d252fe9d97c413" > mlx::core::random::permutation< / a > (const < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > & x, int axis=0, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:ae4636a5e54c4dcc211d252fe9d97c413" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a529adc3488cc649103c0b7316c7ac9b2" id = "r_a529adc3488cc649103c0b7316c7ac9b2" > < 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_1_1random.html#a529adc3488cc649103c0b7316c7ac9b2" > mlx::core::random::permutation< / a > (int x, const std::optional< < a class = "el" href = "classmlx_1_1core_1_1array.html" > array< / a > > & < a class = "el" href = "namespacemlx_1_1core_1_1random.html#acf04b6f42de11383e86dcc7f98c67bd8" > key< / a > =std::nullopt, < a class = "el" href = "namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58" > StreamOrDevice< / a > s={})< / td > < / tr >
< tr class = "separator:a529adc3488cc649103c0b7316c7ac9b2" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
2025-01-10 05:56:20 +08:00
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
< li class = "navelem" > < a class = "el" href = "dir_938ab0ecf10b8b860ff766c820f665fd.html" > mlx< / a > < / li > < li class = "navelem" > < a class = "el" href = "random_8h.html" > random.h< / a > < / li >
2025-02-07 04:16:29 +08:00
< li class = "footer" > Generated by < a href = "https://www.doxygen.org/index.html" > < img class = "footer" src = "doxygen.svg" width = "104" height = "31" alt = "doxygen" / > < / a > 1.13.2 < / li >
2025-01-10 05:56:20 +08:00
< / ul >
< / div >
2024-10-15 23:12:17 +08:00
< / body >
< / html >