You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>If <cite>as_numpy=True</cite>, you need to be able to apply <aclass="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.asarray.html#numpy.asarray" title="(in NumPy v2.2)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">numpy.asarray()</span></code></a> to
294
-
non-None args to convert them to numpy; read notes below about specific
294
+
non-None args to convert them to NumPy; read notes below about specific
295
295
backends.</p>
296
296
</p></li>
297
297
<li><p><strong>shape</strong> (<aclass="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.13)"><em>tuple</em></a><em>[</em><aclass="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a><em> | </em><em>None</em><em>, </em><em>...</em><em>] </em><em>| </em><em>Sequence</em><em>[</em><aclass="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.13)"><em>tuple</em></a><em>[</em><aclass="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a><em> | </em><em>None</em><em>, </em><em>...</em><em>]</em><em>]</em><em>, </em><em>optional</em>) – Output shape or sequence of output shapes, one for each output of <cite>func</cite>.
<dt>If True, convert the input arrays to NumPy before passing them to <cite>func</cite>.</dt><dd><p>This is particularly useful to make numpy-only functions, e.g. written in Cython</p>
303
+
<dt>If True, convert the input arrays to NumPy before passing them to <cite>func</cite>.</dt><dd><p>This is particularly useful to make NumPy-only functions, e.g. written in Cython</p>
304
304
</dd>
305
305
<dt>or Numba, work transparently with array API-compliant arrays.</dt><dd><p>Default: False.</p>
<li><p><strong>func</strong> (<em>callable</em>) – Function to be tested.</p></li>
288
288
<li><p><strong>allow_dask_compute</strong> (<aclass="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a><em>, </em><em>optional</em>) – <p>Number of times <cite>func</cite> is allowed to internally materialize the Dask graph. This
289
289
is typically triggered by <codeclass="docutils literal notranslate"><spanclass="pre">bool()</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">float()</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">np.asarray()</span></code>.</p>
290
-
<p>Set to 1 if you are aware that <cite>func</cite> converts the input parameters to numpy and
290
+
<p>Set to 1 if you are aware that <cite>func</cite> converts the input parameters to NumPy and
291
291
want to let it do so at least for the time being, knowing that it is going to be
292
292
extremely detrimental for performance.</p>
293
293
<p>If a test needs values higher than 1 to pass, it is a canary that the conversion
294
-
to numpy/bool/float is happening multiple times, which translates to multiple
294
+
to NumPy/bool/float is happening multiple times, which translates to multiple
295
295
computations of the whole graph. Short of making the function fully lazy, you
296
296
should at least add explicit calls to <codeclass="docutils literal notranslate"><spanclass="pre">np.asarray()</span></code> early in the function.
297
297
<em>Note:</em> the counter of <cite>allow_dask_compute</cite> resets after each call to <cite>func</cite>, so
0 commit comments