Skip to content

Commit

Permalink
add support for axes as list in dpnp.ndarray.transpose (#1770)
Browse files Browse the repository at this point in the history
* support axes as list

* fix a bug

* update description

* fix docstring when bullet is used 5f99f4e
  • Loading branch information
github-actions[bot] committed Apr 3, 2024
1 parent 4b575c3 commit ef1b352
Show file tree
Hide file tree
Showing 482 changed files with 1,878 additions and 1,874 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: c32331fac9717984a66141cd4b4a88f9
config: 9c5f6bb6edd310ca767f588cb766ff90
tags: 645f666f9bcd5a90fca523b33c5a78b7
74 changes: 42 additions & 32 deletions _modules/dpnp/dpnp_array.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</script>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.15.0dev1+10.g4de1640001 documentation</title>
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.15.0dev1+9.g5f99f4ef35 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />

Expand All @@ -23,7 +23,7 @@

<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=4f42692f"></script>
<script src="../../_static/documentation_options.js?v=22a4555f"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/js/theme.js"></script>
Expand All @@ -43,7 +43,7 @@
Data Parallel Extension for NumPy
</a>
<div class="version">
0.15.0dev1+10.g4de1640001
0.15.0dev1+9.g5f99f4ef35
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
Expand Down Expand Up @@ -678,7 +678,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Copy the array with data type casting.</span>

<span class="sd"> Refer to :obj:`dpnp.astype` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`numpy.ndarray.astype`.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
Expand Down Expand Up @@ -741,12 +741,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<div class="viewcode-block" id="dpnp_array.choose">
<a class="viewcode-back" href="../../reference/generated/dpnp.dpnp_array.dpnp_array.html#dpnp.dpnp_array.dpnp_array.choose">[docs]</a>
<span class="k">def</span> <span class="nf">choose</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">choices</span><span class="p">,</span> <span class="n">out</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s2">&quot;raise&quot;</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Construct an array from an index array and a set of arrays to choose from.</span>

<span class="sd"> Refer to :obj:`dpnp.choose` for full documentation.</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Construct an array from an index array and a set of arrays to choose from.&quot;&quot;&quot;</span>

<span class="k">return</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">choose</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">choices</span><span class="p">,</span> <span class="n">out</span><span class="p">,</span> <span class="n">mode</span><span class="p">)</span></div>

Expand All @@ -772,7 +767,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Complex-conjugate all elements.</span>

<span class="sd"> Refer to :obj:`dpnp.conjugate` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`numpy.ndarray.conj`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -788,7 +783,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return the complex conjugate, element-wise.</span>

<span class="sd"> Refer to :obj:`dpnp.conjugate` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`numpy.ndarray.conjugate`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand Down Expand Up @@ -851,7 +846,9 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return the cumulative sum of the elements along the given axis.</span>

<span class="sd"> Refer to :obj:`dpnp.cumsum` for full documentation.</span>
<span class="sd"> See Also</span>
<span class="sd"> --------</span>
<span class="sd"> :obj:`dpnp.cumsum`</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -866,7 +863,9 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return specified diagonals.</span>

<span class="sd"> Refer to :obj:`dpnp.diagonal` for full documentation.</span>
<span class="sd"> See Also</span>
<span class="sd"> --------</span>
<span class="sd"> :obj:`dpnp.diagonal`</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -879,7 +878,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Dot product of two arrays.</span>

<span class="sd"> Refer to :obj:`dpnp.dot` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`dpnp.dot`.</span>

<span class="sd"> Examples</span>
<span class="sd"> --------</span>
Expand Down Expand Up @@ -1210,7 +1209,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns the prod along a given axis.</span>

<span class="sd"> Refer to :obj:`dpnp.prod` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`dpnp.prod`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -1223,7 +1222,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Puts values of an array into another array along a given axis.</span>

<span class="sd"> Refer to :obj:`dpnp.put` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`numpy.put`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -1236,7 +1235,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return a contiguous flattened array.</span>

<span class="sd"> Refer to :obj:`dpnp.ravel` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`dpnp.ravel`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand Down Expand Up @@ -1289,7 +1288,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Repeat elements of an array.</span>

<span class="sd"> Refer to :obj:`dpnp.repeat` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`dpnp.repeat`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -1302,7 +1301,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns an array containing the same data with a new shape.</span>

<span class="sd"> Refer to :obj:`dpnp.reshape` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`numpy.ndarray.reshape`.</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
Expand Down Expand Up @@ -1336,7 +1335,8 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return array with each element rounded to the given number of decimals.</span>

<span class="sd"> Refer to :obj:`dpnp.round` for full documentation.</span>
<span class="sd"> .. seealso::</span>
<span class="sd"> :obj:`dpnp.around` for full documentation.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand Down Expand Up @@ -1497,7 +1497,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns the sum along a given axis.</span>

<span class="sd"> Refer to :obj:`dpnp.sum` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`dpnp.sum`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -1518,7 +1518,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Interchange two axes of an array.</span>

<span class="sd"> Refer to :obj:`dpnp.swapaxes` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`numpy.swapaxes`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -1531,7 +1531,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Take elements from an array along an axis.</span>

<span class="sd"> Refer to :obj:`dpnp.take` for full documentation.</span>
<span class="sd"> For full documentation refer to :obj:`numpy.take`.</span>

<span class="sd"> &quot;&quot;&quot;</span>

Expand All @@ -1552,21 +1552,31 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>

<span class="sd"> For full documentation refer to :obj:`numpy.ndarray.transpose`.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> axes : None, tuple or list of ints, n ints, optional</span>
<span class="sd"> * ``None`` or no argument: reverses the order of the axes.</span>
<span class="sd"> * tuple or list of ints: `i` in the `j`-th place in the tuple/list</span>
<span class="sd"> means that the array’s `i`-th axis becomes the transposed</span>
<span class="sd"> array’s `j`-th axis.</span>
<span class="sd"> * n ints: same as an n-tuple/n-list of the same ints (this form is</span>
<span class="sd"> intended simply as a “convenience” alternative to the tuple form).</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> y : dpnp.ndarray</span>
<span class="sd"> out : dpnp.ndarray</span>
<span class="sd"> View of the array with its axes suitably permuted.</span>

<span class="sd"> See Also</span>
<span class="sd"> --------</span>
<span class="sd"> :obj:`dpnp.transpose` : Equivalent function.</span>
<span class="sd"> :obj:`dpnp.ndarray.ndarray.T` : Array property returning the array transposed.</span>
<span class="sd"> :obj:`dpnp.ndarray.reshape` : Give a new shape to an array without changing its data.</span>
<span class="sd"> :obj:`dpnp.transpose` : Equivalent function.</span>
<span class="sd"> :obj:`dpnp.ndarray.ndarray.T` : Array property returning the array transposed.</span>
<span class="sd"> :obj:`dpnp.ndarray.reshape` : Give a new shape to an array without changing its data.</span>

<span class="sd"> Examples</span>
<span class="sd"> --------</span>
<span class="sd"> &gt;&gt;&gt; import dpnp as dp</span>
<span class="sd"> &gt;&gt;&gt; a = dp.array([[1, 2], [3, 4]])</span>
<span class="sd"> &gt;&gt;&gt; import dpnp as np</span>
<span class="sd"> &gt;&gt;&gt; a = np.array([[1, 2], [3, 4]])</span>
<span class="sd"> &gt;&gt;&gt; a</span>
<span class="sd"> array([[1, 2],</span>
<span class="sd"> [3, 4]])</span>
Expand All @@ -1577,7 +1587,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="sd"> array([[1, 3],</span>
<span class="sd"> [2, 4]])</span>

<span class="sd"> &gt;&gt;&gt; a = dp.array([1, 2, 3, 4])</span>
<span class="sd"> &gt;&gt;&gt; a = np.array([1, 2, 3, 4])</span>
<span class="sd"> &gt;&gt;&gt; a</span>
<span class="sd"> array([1, 2, 3, 4])</span>
<span class="sd"> &gt;&gt;&gt; a.transpose()</span>
Expand All @@ -1590,7 +1600,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="bp">self</span>

<span class="n">axes_len</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">axes</span><span class="p">)</span>
<span class="k">if</span> <span class="n">axes_len</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">axes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">tuple</span><span class="p">):</span>
<span class="k">if</span> <span class="n">axes_len</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">axes</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">(</span><span class="nb">tuple</span><span class="p">,</span> <span class="nb">list</span><span class="p">)):</span>
<span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>

<span class="n">res</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="fm">__new__</span><span class="p">(</span><span class="n">dpnp_array</span><span class="p">)</span>
Expand Down
6 changes: 3 additions & 3 deletions _modules/dpnp/dpnp_flatiter.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</script>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.15.0dev1+10.g4de1640001 documentation</title>
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.15.0dev1+9.g5f99f4ef35 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />

Expand All @@ -23,7 +23,7 @@

<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=4f42692f"></script>
<script src="../../_static/documentation_options.js?v=22a4555f"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/js/theme.js"></script>
Expand All @@ -43,7 +43,7 @@
Data Parallel Extension for NumPy
</a>
<div class="version">
0.15.0dev1+10.g4de1640001
0.15.0dev1+9.g5f99f4ef35
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
Expand Down
6 changes: 3 additions & 3 deletions _modules/dpnp/dpnp_iface.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</script>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.15.0dev1+10.g4de1640001 documentation</title>
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.15.0dev1+9.g5f99f4ef35 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />

Expand All @@ -23,7 +23,7 @@

<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=4f42692f"></script>
<script src="../../_static/documentation_options.js?v=22a4555f"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/js/theme.js"></script>
Expand All @@ -43,7 +43,7 @@
Data Parallel Extension for NumPy
</a>
<div class="version">
0.15.0dev1+10.g4de1640001
0.15.0dev1+9.g5f99f4ef35
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
Expand Down
6 changes: 3 additions & 3 deletions _modules/dpnp/dpnp_iface_arraycreation.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</script>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.15.0dev1+10.g4de1640001 documentation</title>
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.15.0dev1+9.g5f99f4ef35 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />

Expand All @@ -23,7 +23,7 @@

<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=4f42692f"></script>
<script src="../../_static/documentation_options.js?v=22a4555f"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/js/theme.js"></script>
Expand All @@ -43,7 +43,7 @@
Data Parallel Extension for NumPy
</a>
<div class="version">
0.15.0dev1+10.g4de1640001
0.15.0dev1+9.g5f99f4ef35
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
Expand Down
Loading

0 comments on commit ef1b352

Please sign in to comment.