Skip to content

Commit 098d21b

Browse files
committed
Deploying to gh-pages from @ e5dd419 🚀
1 parent 8fbf9a1 commit 098d21b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

helper-functions.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,13 @@ <h2>Array Method Helpers<a class="headerlink" href="#array-method-helpers" title
398398

399399
<dl class="py function">
400400
<dt class="sig sig-object py" id="array_api_compat.size">
401-
<span class="sig-prename descclassname"><span class="pre">array_api_compat.</span></span><span class="sig-name descname"><span class="pre">size</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#array_api_compat.size" title="Link to this definition"></a></dt>
401+
<span class="sig-prename descclassname"><span class="pre">array_api_compat.</span></span><span class="sig-name descname"><span class="pre">size</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Array</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">int</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></span><a class="headerlink" href="#array_api_compat.size" title="Link to this definition"></a></dt>
402402
<dd><p>Return the total number of elements of x.</p>
403-
<p>This is equivalent to <code class="code docutils literal notranslate"><span class="pre">x.size</span></code> according to the <a class="reference external" href="https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.size.html">standard</a>.
404-
This helper is included because PyTorch defines <code class="code docutils literal notranslate"><span class="pre">size</span></code> in an
405-
<a class="reference external" href="https://pytorch.org/docs/stable/generated/torch.Tensor.size.html#torch.Tensor.size" title="(in PyTorch v2.5)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">incompatible</span> <span class="pre">way</span></code></a>.</p>
403+
<p>This is equivalent to <code class="code docutils literal notranslate"><span class="pre">x.size</span></code> according to the <a class="reference external" href="https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.size.html">standard</a>.</p>
404+
<p>This helper is included because PyTorch defines <code class="code docutils literal notranslate"><span class="pre">size</span></code> in an
405+
<a class="reference external" href="https://pytorch.org/docs/stable/generated/torch.Tensor.size.html#torch.Tensor.size" title="(in PyTorch v2.5)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">incompatible</span> <span class="pre">way</span></code></a>.
406+
It also fixes dask.array’s behaviour which returns nan for unknown sizes, whereas
407+
the standard requires None.</p>
406408
</dd></dl>
407409

408410
</section>

0 commit comments

Comments
 (0)