docs update

This commit is contained in:
Awni Hannun
2024-04-26 08:24:09 -07:00
committed by CircleCI Docs
parent ba26fe5be5
commit 61c03b86a4
502 changed files with 14665 additions and 15103 deletions

View File

@@ -8,7 +8,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>mlx.utils.tree_map &#8212; MLX 0.10.0 documentation</title>
<title>mlx.utils.tree_map &#8212; MLX 0.12.0 documentation</title>
@@ -36,14 +36,14 @@
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=5b4479735964841361fd" />
<script src="../../_static/vendor/fontawesome/6.1.2/js/all.min.js?digest=5b4479735964841361fd"></script>
<script src="../../_static/documentation_options.js?v=cb265169"></script>
<script src="../../_static/documentation_options.js?v=e9e33cf0"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/scripts/sphinx-book-theme.js?v=efea14e4"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'python/_autosummary/mlx.utils.tree_map';</script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Operations" href="../../cpp/ops.html" />
<link rel="next" title="mlx.utils.tree_map_with_path" href="mlx.utils.tree_map_with_path.html" />
<link rel="prev" title="mlx.utils.tree_unflatten" href="mlx.utils.tree_unflatten.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
@@ -131,8 +131,8 @@
<img src="../../_static/mlx_logo.png" class="logo__image only-light" alt="MLX 0.10.0 documentation - Home"/>
<script>document.write(`<img src="../../_static/mlx_logo_dark.png" class="logo__image only-dark" alt="MLX 0.10.0 documentation - Home"/>`);</script>
<img src="../../_static/mlx_logo.png" class="logo__image only-light" alt="MLX 0.12.0 documentation - Home"/>
<script>document.write(`<img src="../../_static/mlx_logo_dark.png" class="logo__image only-dark" alt="MLX 0.12.0 documentation - Home"/>`);</script>
</a></div>
@@ -240,6 +240,7 @@
<li class="toctree-l2"><a class="reference internal" href="mlx.core.new_stream.html">mlx.core.new_stream</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.set_default_stream.html">mlx.core.set_default_stream</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.stream.html">mlx.core.stream</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.synchronize.html">mlx.core.synchronize</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../ops.html">Operations</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-4"><i class="fa-solid fa-chevron-down"></i></label><ul>
@@ -264,6 +265,7 @@
<li class="toctree-l2"><a class="reference internal" href="mlx.core.atleast_2d.html">mlx.core.atleast_2d</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.atleast_3d.html">mlx.core.atleast_3d</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.broadcast_to.html">mlx.core.broadcast_to</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.block_masked_mm.html">mlx.core.block_masked_mm</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.ceil.html">mlx.core.ceil</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.clip.html">mlx.core.clip</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.concatenate.html">mlx.core.concatenate</a></li>
@@ -277,6 +279,7 @@
<li class="toctree-l2"><a class="reference internal" href="mlx.core.cummin.html">mlx.core.cummin</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.cumprod.html">mlx.core.cumprod</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.cumsum.html">mlx.core.cumsum</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.degrees.html">mlx.core.degrees</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.dequantize.html">mlx.core.dequantize</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.diag.html">mlx.core.diag</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.diagonal.html">mlx.core.diagonal</a></li>
@@ -325,6 +328,7 @@
<li class="toctree-l2"><a class="reference internal" href="mlx.core.moveaxis.html">mlx.core.moveaxis</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.multiply.html">mlx.core.multiply</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.negative.html">mlx.core.negative</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.not_equal.html">mlx.core.not_equal</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.ones.html">mlx.core.ones</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.ones_like.html">mlx.core.ones_like</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.outer.html">mlx.core.outer</a></li>
@@ -333,6 +337,7 @@
<li class="toctree-l2"><a class="reference internal" href="mlx.core.prod.html">mlx.core.prod</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.quantize.html">mlx.core.quantize</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.quantized_matmul.html">mlx.core.quantized_matmul</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.radians.html">mlx.core.radians</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.reciprocal.html">mlx.core.reciprocal</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.repeat.html">mlx.core.repeat</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.reshape.html">mlx.core.reshape</a></li>
@@ -436,12 +441,14 @@
<li class="toctree-l2"><a class="reference internal" href="mlx.core.metal.get_cache_memory.html">mlx.core.metal.get_cache_memory</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.metal.set_memory_limit.html">mlx.core.metal.set_memory_limit</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.metal.set_cache_limit.html">mlx.core.metal.set_cache_limit</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.metal.clear_cache.html">mlx.core.metal.clear_cache</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.metal.start_capture.html">mlx.core.metal.start_capture</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.core.metal.stop_capture.html">mlx.core.metal.stop_capture</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../nn.html">Neural Networks</a><input class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-11"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="mlx.nn.value_and_grad.html">mlx.nn.value_and_grad</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.nn.quantize.html">mlx.nn.quantize</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../nn/module.html">Module</a><input class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-12"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.Module.training.html">mlx.nn.Module.training</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.Module.state.html">mlx.nn.Module.state</a></li>
@@ -488,6 +495,7 @@
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.Mish.html">mlx.nn.Mish</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.MultiHeadAttention.html">mlx.nn.MultiHeadAttention</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.PReLU.html">mlx.nn.PReLU</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.QuantizedEmbedding.html">mlx.nn.QuantizedEmbedding</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.QuantizedLinear.html">mlx.nn.QuantizedLinear</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.RMSNorm.html">mlx.nn.RMSNorm</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nn/_autosummary/mlx.nn.ReLU.html">mlx.nn.ReLU</a></li>
@@ -591,6 +599,7 @@
<li class="toctree-l2"><a class="reference internal" href="mlx.utils.tree_flatten.html">mlx.utils.tree_flatten</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.utils.tree_unflatten.html">mlx.utils.tree_unflatten</a></li>
<li class="toctree-l2 current active"><a class="current reference internal" href="#">mlx.utils.tree_map</a></li>
<li class="toctree-l2"><a class="reference internal" href="mlx.utils.tree_map_with_path.html">mlx.utils.tree_map_with_path</a></li>
</ul>
</li>
</ul>
@@ -782,7 +791,7 @@ document.write(`
<dl class="py function">
<dt class="sig sig-object py" id="mlx.utils.tree_map">
<span class="sig-name descname"><span class="pre">tree_map</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fn</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tree</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">rest</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_leaf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#mlx.utils.tree_map" title="Link to this definition">#</a></dt>
<dd><p>Applies <code class="docutils literal notranslate"><span class="pre">fn</span></code> to the leaves of the python tree <code class="docutils literal notranslate"><span class="pre">tree</span></code> and
<dd><p>Applies <code class="docutils literal notranslate"><span class="pre">fn</span></code> to the leaves of the Python tree <code class="docutils literal notranslate"><span class="pre">tree</span></code> and
returns a new collection with the results.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">rest</span></code> is provided, every item is assumed to be a superset of <code class="docutils literal notranslate"><span class="pre">tree</span></code>
and the corresponding leaves are provided as extra positional arguments to
@@ -804,15 +813,15 @@ than to <a class="reference external" href="https://docs.python.org/3/library/fu
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fn</strong> (<em>Callable</em>) The function that processes the leaves of the tree</p></li>
<li><p><strong>tree</strong> (<em>Any</em>) The main python tree that will be iterated upon</p></li>
<li><p><strong>rest</strong> (<em>Tuple</em><em>[</em><em>Any</em><em>]</em>) Extra trees to be iterated together with tree</p></li>
<li><p><strong>is_leaf</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>]</em>) An optional callable that returns True if
the passed object is considered a leaf or False otherwise.</p></li>
<li><p><strong>fn</strong> (<em>callable</em>) The function that processes the leaves of the tree.</p></li>
<li><p><strong>tree</strong> (<em>Any</em>) The main Python tree that will be iterated upon.</p></li>
<li><p><strong>rest</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.12)"><em>tuple</em></a><em>[</em><em>Any</em><em>]</em>) Extra trees to be iterated together with <code class="docutils literal notranslate"><span class="pre">tree</span></code>.</p></li>
<li><p><strong>is_leaf</strong> (<em>callable</em><em>, </em><em>optional</em>) An optional callable that returns <code class="docutils literal notranslate"><span class="pre">True</span></code>
if the passed object is considered a leaf or <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A python tree with the new values returned by <code class="docutils literal notranslate"><span class="pre">fn</span></code>.</p>
<dd class="field-even"><p>A Python tree with the new values returned by <code class="docutils literal notranslate"><span class="pre">fn</span></code>.</p>
</dd>
</dl>
</dd></dl>
@@ -840,11 +849,11 @@ the passed object is considered a leaf or False otherwise.</p></li>
</div>
</a>
<a class="right-next"
href="../../cpp/ops.html"
href="mlx.utils.tree_map_with_path.html"
title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">Operations</p>
<p class="prev-next-title">mlx.utils.tree_map_with_path</p>
</div>
<i class="fa-solid fa-angle-right"></i>
</a>