Files
mlx/docs/build/doctrees/usage/numpy.doctree

109 lines
14 KiB
Plaintext
Raw Normal View History

2024-01-17 17:15:29 -08:00
<EFBFBD><05>C8<00>sphinx.addnodes<65><73>document<6E><74><EFBFBD>)<29><>}<7D>(<28> rawsource<63><65><00><>children<65>]<5D>(<28>docutils.nodes<65><73>target<65><74><EFBFBD>)<29><>}<7D>(h<05>
.. _numpy:<3A>h]<5D><>
attributes<EFBFBD>}<7D>(<28>ids<64>]<5D><>classes<65>]<5D><>names<65>]<5D><>dupnames<65>]<5D><>backrefs<66>]<5D><>refid<69><64>numpy<70>u<EFBFBD>tagname<6D>h
<EFBFBD>line<6E>K<01>parent<6E>h<03> _document<6E>h<03>source<63><65>4/Users/awnihannun/repos/mlx/docs/src/usage/numpy.rst<73>ubh <09>section<6F><6E><EFBFBD>)<29><>}<7D>(hhh]<5D>(h <09>title<6C><65><EFBFBD>)<29><>}<7D>(h<05>(Conversion to NumPy and Other Frameworks<6B>h]<5D>h <09>Text<78><74><EFBFBD><EFBFBD>(Conversion to NumPy and Other Frameworks<6B><73><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h+h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh)h h&h!hh"h#hKubh <09> paragraph<70><68><EFBFBD>)<29><>}<7D>(h<05><>MLX array implements the `Python Buffer Protocol <https://docs.python.org/3/c-api/buffer.html>`_.
Let's convert an array to NumPy and back.<2E>h]<5D>(h0<68>MLX array implements the <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h=h!hh"NhNubh <09> reference<63><65><EFBFBD>)<29><>}<7D>(h<05>G`Python Buffer Protocol <https://docs.python.org/3/c-api/buffer.html>`_<>h]<5D>h0<68>Python Buffer Protocol<6F><6C><EFBFBD><EFBFBD><EFBFBD>}<7D>(h hGh!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D><>name<6D><65>Python Buffer Protocol<6F><6C>refuri<72><69>+https://docs.python.org/3/c-api/buffer.html<6D>uhhEh h=ubh )<29><>}<7D>(h<05>. <https://docs.python.org/3/c-api/buffer.html><3E>h]<5D>h}<7D>(h]<5D><>python-buffer-protocol<6F>ah]<5D>h]<5D><>python buffer protocol<6F>ah]<5D>h]<5D><>refuri<72>hXuhh
<EFBFBD>
referenced<EFBFBD>Kh h=ubh0<68>-.
Lets convert an array to NumPy and back.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h=h!hh"NhNubeh}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hKh h&h!hubh <09> literal_block<63><6B><EFBFBD>)<29><>}<7D>(h<05>rimport mlx.core as mx
import numpy as np
a = mx.arange(3)
b = np.array(a) # copy of a
c = mx.array(b) # copy of b<>h]<5D>h0<68>rimport mlx.core as mx
import numpy as np
a = mx.arange(3)
b = np.array(a) # copy of a
c = mx.array(b) # copy of b<><62><EFBFBD><EFBFBD><EFBFBD>}<7D>h hssbah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D><> xml:space<63><65>preserve<76><65>force<63><65><EFBFBD>language<67><65>python<6F><6E>highlight_args<67>}<7D>uhhqh"h#hK h h&h!hubh <09>note<74><65><EFBFBD>)<29><>}<7D>(hXSince NumPy does not support ``bfloat16`` arrays, you will need to convert to ``float16`` or ``float32`` first:
``np.array(a.astype(mx.float32))``.
Otherwise, you will receive an error like: ``Item size 2 for PEP 3118 buffer format string does not match the dtype V item size 0.``<60>h]<5D>h<)<29><>}<7D>(hXSince NumPy does not support ``bfloat16`` arrays, you will need to convert to ``float16`` or ``float32`` first:
``np.array(a.astype(mx.float32))``.
Otherwise, you will receive an error like: ``Item size 2 for PEP 3118 buffer format string does not match the dtype V item size 0.``<60>h]<5D>(h0<68>Since NumPy does not support <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubh <09>literal<61><6C><EFBFBD>)<29><>}<7D>(h<05> ``bfloat16``<60>h]<5D>h0<68>bfloat16<31><36><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h h<>ubh0<68>% arrays, you will need to convert to <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubh<62>)<29><>}<7D>(h<05> ``float16``<60>h]<5D>h0<68>float16<31><36><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h h<>ubh0<68> or <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubh<62>)<29><>}<7D>(h<05> ``float32``<60>h]<5D>h0<68>float32<33><32><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h h<>ubh0<68> first:
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubh<62>)<29><>}<7D>(h<05>"``np.array(a.astype(mx.float32))``<60>h]<5D>h0<68>np.array(a.astype(mx.float32))<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h h<>ubh0<68>-.
Otherwise, you will receive an error like: <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubh<62>)<29><>}<7D>(h<05>Y``Item size 2 for PEP 3118 buffer format string does not match the dtype V item size 0.``<60>h]<5D>h0<68>UItem size 2 for PEP 3118 buffer format string does not match the dtype V item size 0.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h h<>ubeh}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hKh h<>ubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h h&h!hh"h#hNubh<)<29><>}<7D>(h<05>^By default, NumPy copies data to a new array. This can be prevented by creating an array view:<3A>h]<5D>h0<68>^By default, NumPy copies data to a new array. This can be prevented by creating an array view:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h h<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hKh h&h!hubhr)<29><>}<7D>(h<05>za = mx.arange(3)
a_view = np.array(a, copy=False)
print(a_view.flags.owndata) # False
a_view[0] = 1
print(a[0].item()) # 1<>h]<5D>h0<68>za = mx.arange(3)
a_view = np.array(a, copy=False)
print(a_view.flags.owndata) # False
a_view[0] = 1
print(a[0].item()) # 1<><31><EFBFBD><EFBFBD><EFBFBD>}<7D>h jsbah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>h<EFBFBD>h<EFBFBD>h<EFBFBD><68>h<EFBFBD><68>python<6F>h<EFBFBD>}<7D>uhhqh"h#hKh h&h!hubh<)<29><>}<7D>(h<05><>A NumPy array view is a normal NumPy array, except that it does not own its memory.
This means writing to the view is reflected in the original array.<2E>h]<5D>h0<68><30>A NumPy array view is a normal NumPy array, except that it does not own its memory.
This means writing to the view is reflected in the original array.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jh!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hK"h h&h!hubh<)<29><>}<7D>(h<05><>While this is quite powerful to prevent copying arrays, it should be noted that external changes to the memory of arrays cannot be reflected in gradients.<2E>h]<5D>h0<68><30>While this is quite powerful to prevent copying arrays, it should be noted that external changes to the memory of arrays cannot be reflected in gradients.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j&h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hK%h h&h!hubh<)<29><>}<7D>(h<05>%Let's demonstrate this in an example:<3A>h]<5D>h0<68>'Lets demonstrate this in an example:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j4h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hK'h h&h!hubhr)<29><>}<7D>(h<05><>def f(x):
x_view = np.array(x, copy=False)
x_view[:] *= x_view # modify memory without telling mx
return x.sum()
x = mx.array([3.0])
y, df = mx.value_and_grad(f)(x)
print("f(x) = x² =", y.item()) # 9.0
print("f'(x) = 2x !=", df.item()) # 1.0<EFBFBD>h]<5D>h0<68><30>def f(x):
x_view = np.array(x, copy=False)
x_view[:] *= x_view # modify memory without telling mx
return x.sum()
x = mx.array([3.0])
y, df = mx.value_and_grad(f)(x)
print("f(x) = x² =", y.item()) # 9.0
print("f'(x) = 2x !=", df.item()) # 1.0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>h jBsbah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>h<EFBFBD>h<EFBFBD>h<EFBFBD><68>h<EFBFBD><68>python<6F>h<EFBFBD>}<7D>uhhqh"h#hK)h h&h!hubh<)<29><>}<7D>(hXQThe function ``f`` indirectly modifies the array ``x`` through a memory view.
However, this modification is not reflected in the gradient, as seen in the last line outputting ``1.0``,
representing the gradient of the sum operation alone.
The squaring of ``x`` occurs externally to MLX, meaning that no gradient is incorporated.
It's important to note that a similar issue arises during array conversion and copying.
For instance, a function defined as ``mx.array(np.array(x)**2).sum()`` would also result in an incorrect gradient,
even though no in-place operations on MLX memory are executed.<2E>h]<5D>(h0<68> The function <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jRh!hh"NhNubh<62>)<29><>}<7D>(h<05>``f``<60>h]<5D>h0<68>f<><66><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jZh!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h jRubh0<68> indirectly modifies the array <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jRh!hh"NhNubh<62>)<29><>}<7D>(h<05>``x``<60>h]<5D>h0<68>x<><78><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jlh!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h jRubh0<68>y through a memory view.
However, this modification is not reflected in the gradient, as seen in the last line outputting <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jRh!hh"NhNubh<62>)<29><>}<7D>(h<05>``1.0``<60>h]<5D>h0<68>1.0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j~h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h jRubh0<68>H,
representing the gradient of the sum operation alone.
The squaring of <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jRh!hh"NhNubh<62>)<29><>}<7D>(h<05>``x``<60>h]<5D>h0<68>x<><78><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h jRubh0<68><30> occurs externally to MLX, meaning that no gradient is incorporated.
Its important to note that a similar issue arises during array conversion and copying.
For instance, a function defined as <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jRh!hh"NhNubh<62>)<29><>}<7D>(h<05>"``mx.array(np.array(x)**2).sum()``<60>h]<5D>h0<68>mx.array(np.array(x)**2).sum()<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h jRubh0<68>k would also result in an incorrect gradient,
even though no in-place operations on MLX memory are executed.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jRh!hh"NhNubeh}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hK6h h&h!hubh%)<29><>}<7D>(hhh]<5D>(h*)<29><>}<7D>(h<05>PyTorch<63>h]<5D>h0<68>PyTorch<63><68><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh)h j<>h!hh"h#hK?ubh <09>warning<6E><67><EFBFBD>)<29><>}<7D>(h<05><>PyTorch Support for :obj:`memoryview` is experimental and can break for
multi-dimensional arrays. Casting to NumPy first is advised for now.<2E>h]<5D>h<)<29><>}<7D>(h<05><>PyTorch Support for :obj:`memoryview` is experimental and can break for
multi-dimensional arrays. Casting to NumPy first is advised for now.<2E>h]<5D>(h0<68>PyTorch Support for <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubh<00> pending_xref<65><66><EFBFBD>)<29><>}<7D>(h<05>:obj:`memoryview`<60>h]<5D>h<EFBFBD>)<29><>}<7D>(hj<>h]<5D>h0<68>
memoryview<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>(<28>xref<65><66>py<70><79>py-obj<62>eh]<5D>h]<5D>h]<5D>uhh<>h j<>ubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D><>refdoc<6F><63> usage/numpy<70><79> refdomain<69>j<EFBFBD><00>reftype<70><65>obj<62><6A> refexplicit<69><74><EFBFBD>refwarn<72><6E><EFBFBD> py:module<6C>N<EFBFBD>py:class<73>N<EFBFBD> reftarget<65><74>
memoryview<EFBFBD>uhj<>h"h#hKCh j<>ubh0<68>g is experimental and can break for
multi-dimensional arrays. Casting to NumPy first is advised for now.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubeh}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hKCh j<>ubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhj<>h j<>h!hh"h#hNubh<)<29><>}<7D>(h<05>TPyTorch supports the buffer protocol, but it requires an explicit :obj:`memoryview`.<2E>h]<5D>(h0<68>BPyTorch supports the buffer protocol, but it requires an explicit <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jh!hh"NhNubj<62>)<29><>}<7D>(h<05>:obj:`memoryview`<60>h]<5D>h<EFBFBD>)<29><>}<7D>(hjh]<5D>h0<68>
memoryview<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jh!hh"NhNubah}<7D>(h]<5D>h]<5D>(j<><00>py<70><79>py-obj<62>eh]<5D>h]<5D>h]<5D>uhh<>h jubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D><>refdoc<6F>j<EFBFBD><00> refdomain<69>j&<00>reftype<70><65>obj<62><6A> refexplicit<69><74><EFBFBD>refwarn<72><6E>j<EFBFBD>Nj<4E>Nj<4E><00>
memoryview<EFBFBD>uhj<>h"h#hKFh jubh0<68>.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jh!hh"NhNubeh}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hKFh j<>h!hubhr)<29><>}<7D>(h<05>limport mlx.core as mx
import torch
a = mx.arange(3)
b = torch.tensor(memoryview(a))
c = mx.array(b.numpy())<29>h]<5D>h0<68>limport mlx.core as mx
import torch
a = mx.arange(3)
b = torch.tensor(memoryview(a))
c = mx.array(b.numpy())<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>h jBsbah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>h<EFBFBD>h<EFBFBD>h<EFBFBD><68>h<EFBFBD><68>python<6F>h<EFBFBD>}<7D>uhhqh"h#hKHh j<>h!hubh<)<29><>}<7D>(h<05>kConversion from PyTorch tensors back to arrays must be done via intermediate NumPy arrays with ``numpy()``.<2E>h]<5D>(h0<68>_Conversion from PyTorch tensors back to arrays must be done via intermediate NumPy arrays with <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jRh!hh"NhNubh<62>)<29><>}<7D>(h<05> ``numpy()``<60>h]<5D>h0<68>numpy()<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jZh!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh<>h jRubh0<68>.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h jRh!hh"NhNubeh}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hKQh j<>h!hubeh}<7D>(h]<5D><>pytorch<63>ah]<5D>h]<5D><>pytorch<63>ah]<5D>h]<5D>uhh$h h&h!hh"h#hK?ubh%)<29><>}<7D>(hhh]<5D>(h*)<29><>}<7D>(h<05>JAX<41>h]<5D>h0<68>JAX<41><58><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j}h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh)h jzh!hh"h#hKTubh<)<29><>}<7D>(h<05>'JAX fully supports the buffer protocol.<2E>h]<5D>h0<68>'JAX fully supports the buffer protocol.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hKUh jzh!hubhr)<29><>}<7D>(h<05>`import mlx.core as mx
import jax.numpy as jnp
a = mx.arange(3)
b = jnp.array(a)
c = mx.array(b)<29>h]<5D>h0<68>`import mlx.core as mx
import jax.numpy as jnp
a = mx.arange(3)
b = jnp.array(a)
c = mx.array(b)<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>h j<>sbah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>h<EFBFBD>h<EFBFBD>h<EFBFBD><68>h<EFBFBD><68>python<6F>h<EFBFBD>}<7D>uhhqh"h#hKWh jzh!hubeh}<7D>(h]<5D><>jax<61>ah]<5D>h]<5D><>jax<61>ah]<5D>h]<5D>uhh$h h&h!hh"h#hKTubh%)<29><>}<7D>(hhh]<5D>(h*)<29><>}<7D>(h<05>
TensorFlow<EFBFBD>h]<5D>h0<68>
TensorFlow<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh)h j<>h!hh"h#hKaubh<)<29><>}<7D>(h<05>WTensorFlow supports the buffer protocol, but it requires an explicit :obj:`memoryview`.<2E>h]<5D>(h0<68>ETensorFlow supports the buffer protocol, but it requires an explicit <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubj<62>)<29><>}<7D>(h<05>:obj:`memoryview`<60>h]<5D>h<EFBFBD>)<29><>}<7D>(hj<>h]<5D>h0<68>
memoryview<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubah}<7D>(h]<5D>h]<5D>(j<><00>py<70><79>py-obj<62>eh]<5D>h]<5D>h]<5D>uhh<>h j<>ubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D><>refdoc<6F>j<EFBFBD><00> refdomain<69>j<EFBFBD><00>reftype<70><65>obj<62><6A> refexplicit<69><74><EFBFBD>refwarn<72><6E>j<EFBFBD>Nj<4E>Nj<4E><00>
memoryview<EFBFBD>uhj<>h"h#hKch j<>ubh0<68>.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(h j<>h!hh"NhNubeh}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h"h#hKch j<>h!hubhr)<29><>}<7D>(h<05>nimport mlx.core as mx
import tensorflow as tf
a = mx.arange(3)
b = tf.constant(memoryview(a))
c = mx.array(b)<29>h]<5D>h0<68>nimport mlx.core as mx
import tensorflow as tf
a = mx.arange(3)
b = tf.constant(memoryview(a))
c = mx.array(b)<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>h j<>sbah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>h<EFBFBD>h<EFBFBD>h<EFBFBD><68>h<EFBFBD><68>python<6F>h<EFBFBD>}<7D>uhhqh"h#hKeh j<>h!hubeh}<7D>(h]<5D><>
tensorflow<EFBFBD>ah]<5D>h]<5D><>
tensorflow<EFBFBD>ah]<5D>h]<5D>uhh$h h&h!hh"h#hKaubeh}<7D>(h]<5D>(<28>(conversion-to-numpy-and-other-frameworks<6B>heh]<5D>h]<5D>(<28>(conversion to numpy and other frameworks<6B><73>numpy<70>eh]<5D>h]<5D>uhh$h hh!hh"h#hK<04>expect_referenced_by_name<6D>}<7D>jh s<>expect_referenced_by_id<69>}<7D>hh subeh}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D><>source<63>h#uhh<01>current_source<63>N<EFBFBD> current_line<6E>N<EFBFBD>settings<67><73>docutils.frontend<6E><64>Values<65><73><EFBFBD>)<29><>}<7D>(h)N<> generator<6F>N<EFBFBD> datestamp<6D>N<EFBFBD> source_link<6E>N<EFBFBD>
source_url<EFBFBD>N<EFBFBD> toc_backlinks<6B><73>entry<72><79>footnote_backlinks<6B>K<01> sectnum_xform<72>K<01>strip_comments<74>N<EFBFBD>strip_elements_with_classes<65>N<EFBFBD> strip_classes<65>N<EFBFBD> report_level<65>K<02>
halt_level<EFBFBD>K<05>exit_status_level<65>K<05>debug<75>N<EFBFBD>warning_stream<61>N<EFBFBD> traceback<63><6B><EFBFBD>input_encoding<6E><67> utf-8-sig<69><67>input_encoding_error_handler<65><72>strict<63><74>output_encoding<6E><67>utf-8<><38>output_encoding_error_handler<65>j<<00>error_encoding<6E><67>utf-8<><38>error_encoding_error_handler<65><72>backslashreplace<63><65> language_code<64><65>en<65><6E>record_dependencies<65>N<EFBFBD>config<69>N<EFBFBD> id_prefix<69>h<06>auto_id_prefix<69><78>id<69><64> dump_settings<67>N<EFBFBD>dump_internals<6C>N<EFBFBD>dump_transforms<6D>N<EFBFBD>dump_pseudo_xml<6D>N<EFBFBD>expose_internals<6C>N<EFBFBD>strict_visitor<6F>N<EFBFBD>_disable_config<69>N<EFBFBD>_source<63>h#<23> _destination<6F>N<EFBFBD> _config_files<65>]<5D><>file_insertion_enabled<65><64><EFBFBD> raw_enabled<65>K<01>line_length_limit<69>M'<27>pep_references<65>N<EFBFBD> pep_base_url<72><6C>https://peps.python.org/<2F><>pep_file_url_template<74><65>pep-%04d<34><64>rfc_references<65>N<EFBFBD> rfc_base_url<72><6C>&https://datatracker.ietf.org/doc/html/<2F><> tab_width<74>K<08>trim_footnote_reference_space<63><65><EFBFBD>syntax_highlight<68><74>long<6E><67> smart_quotes<65><73><EFBFBD>smartquotes_locales<65>]<5D><>character_level_inline_markup<75><70><EFBFBD>doctitle_xform<72><6D><EFBFBD> docinfo_xform<72>K<01>sectsubtitle_xform<72><6D><EFBFBD> image_loading<6E><67>link<6E><6B>embed_stylesheet<65><74><EFBFBD>cloak_email_addresses<65><73><EFBFBD>section_self_link<6E><6B><EFBFBD>env<6E>Nub<75>reporter<65>N<EFBFBD>indirect_targets<74>]<5D><>substitution_defs<66>}<7D><>substitution_names<65>}<7D><>refnames<65>}<7D><>refids<64>}<7D>h]<5D>h as<61>nameids<64>}<7D>(jhjjhbh_jwjtj<>j<>j ju<> nametypes<65>}<7D>(j<00>j<00>hb<68>jw<00>j<EFBFBD><00>j <00>uh}<7D>(hh&jh&h_hYjtj<>j<>jzjj<>u<> footnote_refs<66>}<7D><> citation_refs<66>}<7D><> autofootnotes<65>]<5D><>autofootnote_refs<66>]<5D><>symbol_footnotes<65>]<5D><>symbol_footnote_refs<66>]<5D><> footnotes<65>]<5D><> citations<6E>]<5D><>autofootnote_start<72>K<01>symbol_footnote_start<72>K<00>
id_counter<EFBFBD><EFBFBD> collections<6E><73>Counter<65><72><EFBFBD>}<7D><><EFBFBD>R<EFBFBD><52>parse_messages<65>]<5D><>transform_messages<65>]<5D>h <09>system_message<67><65><EFBFBD>)<29><>}<7D>(hhh]<5D>h<)<29><>}<7D>(hhh]<5D>h0<68>+Hyperlink target "numpy" is not referenced.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>h j<>sbah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D>uhh;h j<>ubah}<7D>(h]<5D>h]<5D>h]<5D>h]<5D>h]<5D><>level<65>K<01>type<70><65>INFO<46><4F>source<63>h#<23>line<6E>Kuhj<>uba<62> transformer<65>N<EFBFBD> include_log<6F>]<5D><>
decoration<EFBFBD>Nh!hub.