Skip to content

Commit 1e74f06

Browse files
Update docs for array creation functions 6d0cf4b
1 parent a41e0eb commit 1e74f06

File tree

477 files changed

+1465
-1432
lines changed

Some content is hidden

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

477 files changed

+1465
-1432
lines changed

pull/1674/.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: f52841d903fc2acbdac491cdccaa9b51
3+
config: 69054c5aad91e79324db10829ada14b9
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

pull/1674/_modules/dpnp/dpnp_array.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_array &mdash; Data Parallel Extension for NumPy 0.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/1674/_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.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/1674/_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.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/1674/_modules/dpnp/dpnp_iface_arraycreation.html

Lines changed: 28 additions & 12 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.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
@@ -716,7 +716,7 @@ <h1>Source code for dpnp.dpnp_iface_arraycreation</h1><div class="highlight"><pr
716716
<span class="p">)</span>
717717

718718
<span class="c1"># at least 1-d array has to be returned</span>
719-
<span class="k">if</span> <span class="n">a</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
719+
<span class="k">if</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">isscalar</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="ow">or</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="s2">&quot;ndim&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">a</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
720720
<span class="n">a</span> <span class="o">=</span> <span class="p">[</span><span class="n">a</span><span class="p">]</span>
721721

722722
<span class="k">return</span> <span class="n">asarray</span><span class="p">(</span>
@@ -830,7 +830,7 @@ <h1>Source code for dpnp.dpnp_iface_arraycreation</h1><div class="highlight"><pr
830830
<span class="p">)</span>
831831

832832
<span class="c1"># at least 1-d array has to be returned</span>
833-
<span class="k">if</span> <span class="n">a</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
833+
<span class="k">if</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">isscalar</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="ow">or</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="s2">&quot;ndim&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">a</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
834834
<span class="n">a</span> <span class="o">=</span> <span class="p">[</span><span class="n">a</span><span class="p">]</span>
835835

836836
<span class="k">return</span> <span class="n">asarray</span><span class="p">(</span>
@@ -909,6 +909,21 @@ <h1>Source code for dpnp.dpnp_iface_arraycreation</h1><div class="highlight"><pr
909909
<span class="sd"> &gt;&gt;&gt; x[0] == z[0]</span>
910910
<span class="sd"> array(False)</span>
911911

912+
<span class="sd"> Creating an array on a different device or with a specified usm_type</span>
913+
914+
<span class="sd"> &gt;&gt;&gt; x0 = np.array([1, 2, 3])</span>
915+
<span class="sd"> &gt;&gt;&gt; x = np.copy(x0) # default case</span>
916+
<span class="sd"> &gt;&gt;&gt; x, x.device, x.usm_type</span>
917+
<span class="sd"> (array([1, 2, 3]), Device(level_zero:gpu:0), &#39;device&#39;)</span>
918+
919+
<span class="sd"> &gt;&gt;&gt; y = np.copy(x0, device=&quot;cpu&quot;)</span>
920+
<span class="sd"> &gt;&gt;&gt; y, y.device, y.usm_type</span>
921+
<span class="sd"> (array([1, 2, 3]), Device(opencl:cpu:0), &#39;device&#39;)</span>
922+
923+
<span class="sd"> &gt;&gt;&gt; z = np.copy(x0, usm_type=&quot;host&quot;)</span>
924+
<span class="sd"> &gt;&gt;&gt; z, z.device, z.usm_type</span>
925+
<span class="sd"> (array([1, 2, 3]), Device(level_zero:gpu:0), &#39;host&#39;)</span>
926+
912927
<span class="sd"> &quot;&quot;&quot;</span>
913928

914929
<span class="k">if</span> <span class="n">subok</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">False</span><span class="p">:</span>
@@ -917,13 +932,14 @@ <h1>Source code for dpnp.dpnp_iface_arraycreation</h1><div class="highlight"><pr
917932
<span class="sa">f</span><span class="s2">&quot;default value ``False``, but got </span><span class="si">{</span><span class="n">subok</span><span class="si">}</span><span class="s2">&quot;</span>
918933
<span class="p">)</span>
919934

920-
<span class="k">if</span> <span class="p">(</span>
921-
<span class="n">device</span> <span class="ow">is</span> <span class="kc">None</span>
922-
<span class="ow">and</span> <span class="n">usm_type</span> <span class="ow">is</span> <span class="kc">None</span>
923-
<span class="ow">and</span> <span class="n">sycl_queue</span> <span class="ow">is</span> <span class="kc">None</span>
924-
<span class="ow">and</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">is_supported_array_type</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
925-
<span class="p">):</span>
926-
<span class="k">return</span> <span class="n">dpnp_container</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="n">order</span><span class="p">)</span>
935+
<span class="k">if</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">is_supported_array_type</span><span class="p">(</span><span class="n">a</span><span class="p">):</span>
936+
<span class="n">sycl_queue_normalized</span> <span class="o">=</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">get_normalized_queue_device</span><span class="p">(</span>
937+
<span class="n">a</span><span class="p">,</span> <span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">,</span> <span class="n">sycl_queue</span><span class="o">=</span><span class="n">sycl_queue</span>
938+
<span class="p">)</span>
939+
<span class="k">if</span> <span class="p">(</span>
940+
<span class="n">usm_type</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">usm_type</span> <span class="o">==</span> <span class="n">a</span><span class="o">.</span><span class="n">usm_type</span>
941+
<span class="p">)</span> <span class="ow">and</span> <span class="n">sycl_queue_normalized</span> <span class="o">==</span> <span class="n">a</span><span class="o">.</span><span class="n">sycl_queue</span><span class="p">:</span>
942+
<span class="k">return</span> <span class="n">dpnp_container</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="n">order</span><span class="p">)</span>
927943

928944
<span class="k">return</span> <span class="n">array</span><span class="p">(</span>
929945
<span class="n">a</span><span class="p">,</span>

pull/1674/_modules/dpnp/dpnp_iface_bitwise.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_bitwise &mdash; Data Parallel Extension for NumPy 0.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_iface_bitwise &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/1674/_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.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/1674/_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.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_iface_indexing &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/1674/_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.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_iface_libmath &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

pull/1674/_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.13.1dev3+20.g469ca6e321 documentation</title>
15+
<title>dpnp.dpnp_iface_linearalgebra &mdash; Data Parallel Extension for NumPy 0.13.1dev3+24.g6d0cf4b2da 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=ca113034"></script>
26+
<script src="../../_static/documentation_options.js?v=2618cbe6"></script>
2727
<script src="../../_static/doctools.js?v=888ff710"></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.13.1dev3+20.g469ca6e321
46+
0.13.1dev3+24.g6d0cf4b2da
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)