Skip to content

Commit 3f2bcf3

Browse files
Add implementation of dpnp.matrix_transpose() and .mT attribute for dpnp.array 1709950
1 parent 15e2bb5 commit 3f2bcf3

File tree

625 files changed

+4492
-1838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

625 files changed

+4492
-1838
lines changed

pull/2095/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 2b6dafc5006c0aa724ffedfb34bc6bd1
3+
config: 2d10ed4e9cfa4a67f94561cea47454df
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

pull/2095/_modules/dpnp/dpnp_array.html

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
@@ -205,7 +205,42 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
205205

206206
<span class="nd">@property</span>
207207
<span class="k">def</span> <span class="nf">mT</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
208-
<span class="w"> </span><span class="sd">&quot;&quot;&quot;View of the matrix transposed array.&quot;&quot;&quot;</span>
208+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
209+
<span class="sd"> View of the matrix transposed array.</span>
210+
211+
<span class="sd"> The matrix transpose is the transpose of the last two dimensions, even</span>
212+
<span class="sd"> if the array is of higher dimension.</span>
213+
214+
<span class="sd"> Raises</span>
215+
<span class="sd"> ------</span>
216+
<span class="sd"> ValueError</span>
217+
<span class="sd"> If the array is of dimension less than 2.</span>
218+
219+
<span class="sd"> Examples</span>
220+
<span class="sd"> --------</span>
221+
<span class="sd"> &gt;&gt;&gt; import dpnp as np</span>
222+
<span class="sd"> &gt;&gt;&gt; a = np.array([[1, 2], [3, 4]])</span>
223+
<span class="sd"> &gt;&gt;&gt; a</span>
224+
<span class="sd"> array([[1, 2],</span>
225+
<span class="sd"> [3, 4]])</span>
226+
<span class="sd"> &gt;&gt;&gt; a.mT</span>
227+
<span class="sd"> array([[1, 3],</span>
228+
<span class="sd"> [2, 4]])</span>
229+
230+
<span class="sd"> &gt;&gt;&gt; a = np.arange(8).reshape((2, 2, 2))</span>
231+
<span class="sd"> &gt;&gt;&gt; a</span>
232+
<span class="sd"> array([[[0, 1],</span>
233+
<span class="sd"> [2, 3]],</span>
234+
<span class="sd"> [[4, 5],</span>
235+
<span class="sd"> [6, 7]]])</span>
236+
<span class="sd"> &gt;&gt;&gt; a.mT</span>
237+
<span class="sd"> array([[[0, 2],</span>
238+
<span class="sd"> [1, 3]],</span>
239+
<span class="sd"> [[4, 6],</span>
240+
<span class="sd"> [5, 7]]])</span>
241+
242+
<span class="sd"> &quot;&quot;&quot;</span>
243+
209244
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ndim</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">:</span>
210245
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;matrix transpose with ndim &lt; 2 is undefined&quot;</span><span class="p">)</span>
211246

@@ -1505,7 +1540,7 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
15051540

15061541
<div class="viewcode-block" id="dpnp_array.reshape">
15071542
<a class="viewcode-back" href="../../reference/generated/dpnp.dpnp_array.dpnp_array.html#dpnp.dpnp_array.dpnp_array.reshape">[docs]</a>
1508-
<span class="k">def</span> <span class="nf">reshape</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">sh</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
1543+
<span class="k">def</span> <span class="nf">reshape</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">shape</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="s2">&quot;C&quot;</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
15091544
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
15101545
<span class="sd"> Returns an array containing the same data with a new shape.</span>
15111546

@@ -1530,9 +1565,9 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
15301565

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

1533-
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sh</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
1534-
<span class="n">sh</span> <span class="o">=</span> <span class="n">sh</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
1535-
<span class="k">return</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sh</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>
1568+
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">shape</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
1569+
<span class="n">shape</span> <span class="o">=</span> <span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
1570+
<span class="k">return</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">shape</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="n">order</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span></div>
15361571

15371572

15381573
<span class="c1"># &#39;resize&#39;,</span>

pull/2095/_modules/dpnp/dpnp_flatiter.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/2095/_modules/dpnp/dpnp_iface.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/2095/_modules/dpnp/dpnp_iface_arraycreation.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/2095/_modules/dpnp/dpnp_iface_counting.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/2095/_modules/dpnp/dpnp_iface_histograms.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_histograms &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_iface_histograms &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/2095/_modules/dpnp/dpnp_iface_indexing.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_indexing &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_iface_indexing &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/2095/_modules/dpnp/dpnp_iface_libmath.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_libmath &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_iface_libmath &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/2095/_modules/dpnp/dpnp_iface_linearalgebra.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_linearalgebra &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_iface_linearalgebra &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/2095/_modules/dpnp/dpnp_iface_logic.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_logic &mdash; Data Parallel Extension for NumPy 0.17.0dev0+41.g10311c3eaa6 documentation</title>
15+
<title>dpnp.dpnp_iface_logic &mdash; Data Parallel Extension for NumPy 0.17.0dev0+52.g170995067fc documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=b8493344"></script>
26+
<script src="../../_static/documentation_options.js?v=996d3070"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.17.0dev0+41.g10311c3eaa6
46+
0.17.0dev0+52.g170995067fc
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

0 commit comments

Comments
 (0)